Skip to content

Commit e5b63ab

Browse files
authored
Merge pull request #69 from CommunityToolkit/feature/8.0.0-preview2-update
8.0.0-preview2 update
2 parents 17f1251 + cd0de12 commit e5b63ab

File tree

82 files changed

+1789
-2891
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+1789
-2891
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Refactor to file-scoped namespaces
2+
4c8a30e4d6588d0921dca49e8ab3fb1c01e35c08

azure-pipelines.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,26 @@ variables:
1616

1717
steps:
1818
- task: NuGetToolInstaller@1
19+
displayName: Install NuGet tool
1920

2021
- task: NuGetCommand@2
22+
displayName: Restore solution(s)
2123
inputs:
2224
command: 'restore'
2325
restoreSolution: '**/*.sln'
2426
feedsToUse: 'config'
2527
nugetConfigPath: ./samples/nuget.config
2628

2729
- task: VSBuild@1
30+
displayName: Build UWP solution
2831
inputs:
2932
platform: 'x86'
3033
solution: '$(solutionUwp)'
3134
configuration: '$(buildConfiguration)'
3235
msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload'
3336

3437
- task: VSBuild@1
38+
displayName: Build Xamarin.Forms solution
3539
inputs:
3640
platform: 'Any CPU'
3741
solution: '$(solutionXf)'

docs/mvvm/AsyncRelayCommand.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ dev_langs:
99

1010
# AsyncRelayCommand and AsyncRelayCommand<T>
1111

12-
The [`AsyncRelayCommand`](https://docs.microsoft.com/dotnet/api/microsoft.toolkit.mvvm.input.AsyncRelayCommand) and [`AsyncRelayCommand<T>`](https://docs.microsoft.com/dotnet/api/microsoft.toolkit.mvvm.input.AsyncRelayCommand-1) are `ICommand` implementations that extend the functionalities offered by [`RelayCommand`](https://docs.microsoft.com/dotnet/api/microsoft.toolkit.mvvm.input.RelayCommand), with support for asynchronous operations.
12+
The [`AsyncRelayCommand`](/dotnet/api/microsoft.toolkit.mvvm.input.AsyncRelayCommand) and [`AsyncRelayCommand<T>`](/dotnet/api/microsoft.toolkit.mvvm.input.AsyncRelayCommand-1) are `ICommand` implementations that extend the functionalities offered by [`RelayCommand`](/dotnet/api/microsoft.toolkit.mvvm.input.RelayCommand), with support for asynchronous operations.
1313

14-
> **Platform APIs:** [`AsyncRelayCommand`](https://docs.microsoft.com/dotnet/api/microsoft.toolkit.mvvm.input.AsyncRelayCommand), [`AsyncRelayCommand<T>`](https://docs.microsoft.com/dotnet/api/microsoft.toolkit.mvvm.input.AsyncRelayCommand-1), [`RelayCommand`](https://docs.microsoft.com/dotnet/api/microsoft.toolkit.mvvm.input.RelayCommand), [`IAsyncRelayCommand`](https://docs.microsoft.com/dotnet/api/microsoft.toolkit.mvvm.input.IAsyncRelayCommand), [`IAsyncRelayCommand<T>`](https://docs.microsoft.com/dotnet/api/microsoft.toolkit.mvvm.input.IAsyncRelayCommand-1)
14+
> **Platform APIs:** [`AsyncRelayCommand`](/dotnet/api/microsoft.toolkit.mvvm.input.AsyncRelayCommand), [`AsyncRelayCommand<T>`](/dotnet/api/microsoft.toolkit.mvvm.input.AsyncRelayCommand-1), [`RelayCommand`](/dotnet/api/microsoft.toolkit.mvvm.input.RelayCommand), [`IAsyncRelayCommand`](/dotnet/api/microsoft.toolkit.mvvm.input.IAsyncRelayCommand), [`IAsyncRelayCommand<T>`](/dotnet/api/microsoft.toolkit.mvvm.input.IAsyncRelayCommand-1)
1515
1616
## How they work
1717

@@ -20,7 +20,7 @@ The [`AsyncRelayCommand`](https://docs.microsoft.com/dotnet/api/microsoft.toolki
2020
- They extend the functionalities of the synchronous commands included in the library, with support for `Task`-returning delegates.
2121
- They can wrap asynchronous functions with an additional `CancellationToken` parameter to support cancelation, and they expose a `CanBeCanceled` and `IsCancellationRequested` properties, as well as a `Cancel` method.
2222
- They expose an `ExecutionTask` property that can be used to monitor the progress of a pending operation, and an `IsRunning` that can be used to check when an operation completes. This is particularly useful to bind a command to UI elements such as loading indicators.
23-
- They implement the [`IAsyncRelayCommand`](https://docs.microsoft.com/dotnet/api/microsoft.toolkit.mvvm.input.IAsyncRelayCommand) and [`IAsyncRelayCommand<T>`](https://docs.microsoft.com/dotnet/api/microsoft.toolkit.mvvm.input.IAsyncRelayCommand-1) interfaces, which means that viewmodel can easily expose commands using these to reduce the tight coupling between types. For instance, this makes it easier to replace a command with a custom implementation exposing the same public API surface, if needed.
23+
- They implement the [`IAsyncRelayCommand`](/dotnet/api/microsoft.toolkit.mvvm.input.IAsyncRelayCommand) and [`IAsyncRelayCommand<T>`](/dotnet/api/microsoft.toolkit.mvvm.input.IAsyncRelayCommand-1) interfaces, which means that viewmodel can easily expose commands using these to reduce the tight coupling between types. For instance, this makes it easier to replace a command with a custom implementation exposing the same public API surface, if needed.
2424

2525
## Working with asynchronous commands
2626

@@ -79,4 +79,5 @@ Upon clicking the `Button`, the command is invoked, and the `ExecutionTask` upda
7979

8080
## Examples
8181

82-
You can find more examples in the [unit tests](https://github.com/Microsoft/WindowsCommunityToolkit//blob/master/UnitTests/UnitTests.Shared/Mvvm).
82+
- Check out the [sample app](https://github.com/windows-toolkit/MVVM-Samples) (for multiple UI frameworks) to see the MVVM Toolkit in action.
83+
- You can also find more examples in the [unit tests](https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/rel/7.1.0/UnitTests/UnitTests.Shared/Mvvm).

docs/mvvm/Introduction.md

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
---
2-
title: Introduction to the MVVM package
2+
title: Introduction to the MVVM Toolkit
33
author: Sergio0694
4-
description: An overview of how to get started with MVVM package and to the APIs it contains
4+
description: An overview of how to get started with the MVVM Toolkit and to the APIs it contains
55
keywords: windows 10, uwp, windows community toolkit, uwp community toolkit, uwp toolkit, get started, visual studio, MVVM, net core, net standard
66
dev_langs:
77
- csharp
88
- vb
99
---
1010

11-
# Introduction to the MVVM package
11+
# Introduction to the MVVM Toolkit
1212

13-
The `Microsoft.Toolkit.Mvvm` package is a modern, fast, and modular MVVM library. It is part of the Windows Community Toolkit and is built around the following principles:
13+
The `Microsoft.Toolkit.Mvvm` package (aka MVVM Toolkit) is a modern, fast, and modular MVVM library. It is part of the Windows Community Toolkit and is built around the following principles:
1414

15-
- **Platform and Runtime Independent** - **.NET Standard 2.0** 🚀 (UI Framework Agnostic)
15+
- **Platform and Runtime Independent** - **.NET Standard 2.0** and **.NET 5** 🚀 (UI Framework Agnostic)
1616
- **Simple to pick-up and use** - No strict requirements on Application structure or coding-paradigms (outside of 'MVVM'ness), i.e., flexible usage.
1717
- **À la carte** - Freedom to choose which components to use.
1818
- **Reference Implementation** - Lean and performant, providing implementations for interfaces that are included in the Base Class Library, but lack concrete types to use them directly.
1919

20-
This package targets .NET Standard so it can be used on any app platform: UWP, WinForms, WPF, Xamarin, Uno, and more; and on any runtime: .NET Native, .NET Core, .NET Framework, or Mono. It runs on all of them. The API surface is identical in all cases, making it perfect for building shared libraries.
20+
This package targets **.NET Standard** so it can be used on any app platform: UWP, WinForms, WPF, Xamarin, Uno, and more; and on any runtime: .NET Native, .NET Core, .NET Framework, or Mono. It runs on all of them. The API surface is identical in all cases, making it perfect for building shared libraries.
21+
22+
Additionally, the MVVM Toolkit also has a **.NET 5** target, which is used to enable more internal optimizations when running in on the .NET 5 runtime. The public API surface is identical in both cases, so NuGet will always resolve the best possible version of the package without consumers having to worry about which APIs will be available on their platform.
2123

2224
To install the package from within Visual Studio:
2325

@@ -30,11 +32,12 @@ To install the package from within Visual Studio:
3032
```c#
3133
using Microsoft.Toolkit.Mvvm;
3234
```
35+
3336
```vb
3437
Imports Microsoft.Toolkit.Mvvm
3538
```
3639

37-
3. Code samples are available in the other docs pages for the MVVM package, and in the [unit tests](https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/UnitTests/UnitTests.Shared/Mvvm) for the project.
40+
3. Code samples are available in the other docs pages for the MVVM Toolkit, and in the [unit tests](https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/rel/7.1.0/UnitTests/UnitTests.Shared/Mvvm) for the project.
3841
3942
## When should I use this package?
4043

@@ -43,28 +46,37 @@ Use this package for access to a collection of standard, self-contained, lightwe
4346
The included types are:
4447

4548
- **Microsoft.Toolkit.Mvvm.ComponentModel**
46-
- `ObservableObject`
47-
- `ObservableRecipient`
49+
- [`ObservableObject`](ObservableObject.md)
50+
- [`ObservableRecipient`](ObservableRecipient.md)
51+
- [`ObservableValidator`](ObservableValidator.md)
4852
- **Microsoft.Toolkit.Mvvm.DependencyInjection**
49-
- `Ioc`
53+
- [`Ioc`](Ioc.md)
5054
- **Microsoft.Toolkit.Mvvm.Input**
51-
- `RelayCommand`
52-
- `RelayCommand<T>`
53-
- `AsyncRelayCommand`
54-
- `AsyncRelayCommand<T>`
55-
- `IRelayCommand`
56-
- `IRelayCommand<in T>`
57-
- `IAsyncRelayCommand`
58-
- `IAsyncRelayCommand<in T>`
55+
- [`RelayCommand`](RelayCommand.md)
56+
- [`RelayCommand<T>`](RelayCommand.md)
57+
- [`AsyncRelayCommand`](AsyncRelayCommand.md)
58+
- [`AsyncRelayCommand<T>`](AsyncRelayCommand.md)
59+
- [`IRelayCommand`](RelayCommand.md)
60+
- [`IRelayCommand<in T>`](RelayCommand.md)
61+
- [`IAsyncRelayCommand`](AsyncRelayCommand.md)
62+
- [`IAsyncRelayCommand<in T>`](AsyncRelayCommand.md)
5963
- **Microsoft.Toolkit.Mvvm.Messaging**
60-
- `Messenger`
61-
- `IMessenger`
64+
- [`IMessenger`](Messenger.md)
65+
- [`WeakReferenceMessenger`](Messenger.md)
66+
- [`StrongReferenceMessenger`](Messenger.md)
67+
- [`IRecipient<TMessage>`](Messenger.md)
68+
- [`MessageHandler<TRecipient, TMessage>`](Messenger.md)
6269
- **Microsoft.Toolkit.Mvvm.Messaging.Messages**
63-
- `PropertyChangedMessage<T>`
64-
- `RequestMessage<T>`
65-
- `AsyncRequestMessage<T>`
66-
- `CollectionRequestMessage<T>`
67-
- `AsyncCollectionRequestMessage<T>`
68-
- `ValueChangedMessage<T>`
70+
- [`PropertyChangedMessage<T>`](/dotnet/api/microsoft.toolkit.mvvm.Messaging.Messages.PropertyChangedMessage-1)
71+
- [`RequestMessage<T>`](/dotnet/api/microsoft.toolkit.mvvm.Messaging.Messages.RequestMessage-1)
72+
- [`AsyncRequestMessage<T>`](/dotnet/api/microsoft.toolkit.mvvm.Messaging.Messages.AsyncRequestMessage-1)
73+
- [`CollectionRequestMessage<T>`](/dotnet/api/microsoft.toolkit.mvvm.Messaging.Messages.CollectionRequestMessage-1)
74+
- [`AsyncCollectionRequestMessage<T>`](/dotnet/api/microsoft.toolkit.mvvm.Messaging.Messages.AsyncCollectionRequestMessage-1)
75+
- [`ValueChangedMessage<T>`](/dotnet/api/microsoft.toolkit.mvvm.Messaging.Messages.ValueChangedMessage-1)
6976

7077
This package aims to offer as much flexibility as possible, so developers are free to choose which components to use. All types are loosely-coupled, so that it's only necessary to include what you use. There is no requirement to go "all-in" with a specific series of all-encompassing APIs, nor is there a set of mandatory patterns that need to be followed when building apps using these helpers. Combine these building blocks in a way that best fits your needs.
78+
79+
## Additional resources
80+
81+
- Check out the [sample app](https://github.com/windows-toolkit/MVVM-Samples) (for multiple UI frameworks) to see the MVVM Toolkit in action.
82+
- You can also find more examples in the [unit tests](https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/rel/7.1.0/UnitTests/UnitTests.Shared/Mvvm).

docs/mvvm/Ioc.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A common pattern that can be used to increase modularity in the codebase of an a
1313

1414
The MVVM Toolkit doesn't provide built-in APIs to facilitate the usage of this pattern, as there already exist dedicated libraries specifically for this such as the `Microsoft.Extensions.DependencyInjection` package, which provides a fully featured and powerful DI set of APIs, and acts as an easy to setup and use `IServiceProvider`. The following guide will refer to this library and provide a series of examples of how to integrate it into applications using the MVVM pattern.
1515

16-
> **Platform APIs:** [`Ioc`](Microsoft.Toolkit.Mvvm.DependencyInjection.Ioc)
16+
> **Platform APIs:** [`Ioc`](/dotnet/api/Microsoft.Toolkit.Mvvm.DependencyInjection.Ioc)
1717
1818
## Configure and resolve services
1919

@@ -147,8 +147,9 @@ public ContactsView()
147147

148148
## More docs
149149

150-
For more info about `Microsoft.Extensions.DependencyInjection`, see [here](https://docs.microsoft.com/aspnet/core/fundamentals/dependency-injection).
150+
For more info about `Microsoft.Extensions.DependencyInjection`, see [here](/aspnet/core/fundamentals/dependency-injection).
151151

152152
## Examples
153153

154-
You can find more examples in the [unit tests](https://github.com/Microsoft/WindowsCommunityToolkit//blob/master/UnitTests/UnitTests.Shared/Mvvm).
154+
- Check out the [sample app](https://github.com/windows-toolkit/MVVM-Samples) (for multiple UI frameworks) to see the MVVM Toolkit in action.
155+
- You can also find more examples in the [unit tests](https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/rel/7.1.0/UnitTests/UnitTests.Shared/Mvvm).

0 commit comments

Comments
 (0)