diff --git a/src/CommunityToolkit.Mvvm/Collections/ObservableGroupedCollection{TKey,TElement}.cs b/src/CommunityToolkit.Mvvm/Collections/ObservableGroupedCollection{TKey,TElement}.cs index 3879a736d..8b843917e 100644 --- a/src/CommunityToolkit.Mvvm/Collections/ObservableGroupedCollection{TKey,TElement}.cs +++ b/src/CommunityToolkit.Mvvm/Collections/ObservableGroupedCollection{TKey,TElement}.cs @@ -15,7 +15,7 @@ namespace CommunityToolkit.Mvvm.Collections; /// /// The type of the group keys. /// The type of elements in the collection. -public sealed class ObservableGroupedCollection : ObservableCollection>, ILookup +public sealed partial class ObservableGroupedCollection : ObservableCollection>, ILookup where TKey : notnull { /// diff --git a/src/CommunityToolkit.Mvvm/Collections/ReadOnlyObservableGroupedCollection{TKey,TElement}.cs b/src/CommunityToolkit.Mvvm/Collections/ReadOnlyObservableGroupedCollection{TKey,TElement}.cs index e8f9551ca..d730ea7e1 100644 --- a/src/CommunityToolkit.Mvvm/Collections/ReadOnlyObservableGroupedCollection{TKey,TElement}.cs +++ b/src/CommunityToolkit.Mvvm/Collections/ReadOnlyObservableGroupedCollection{TKey,TElement}.cs @@ -17,7 +17,7 @@ namespace CommunityToolkit.Mvvm.Collections; /// /// The type of the group keys. /// The type of elements in the collection. -public sealed class ReadOnlyObservableGroupedCollection : ReadOnlyObservableCollection>, ILookup +public sealed partial class ReadOnlyObservableGroupedCollection : ReadOnlyObservableCollection>, ILookup where TKey : notnull { /// diff --git a/src/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj b/src/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj index e6c7d8be2..77f4abdaf 100644 --- a/src/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj +++ b/src/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj @@ -1,7 +1,24 @@ - netstandard2.0;netstandard2.1;net6.0;net8.0 + netstandard2.0;netstandard2.1;net6.0;net8.0;net8.0-windows10.0.17763.0 + + + + + 10.0.17763.39 + + + false + + + 2 @@ -34,6 +51,11 @@ + + + + + @@ -87,5 +109,4 @@ - \ No newline at end of file diff --git a/src/CommunityToolkit.Mvvm/DependencyInjection/Ioc.cs b/src/CommunityToolkit.Mvvm/DependencyInjection/Ioc.cs index 3050d27e4..09c1006e0 100644 --- a/src/CommunityToolkit.Mvvm/DependencyInjection/Ioc.cs +++ b/src/CommunityToolkit.Mvvm/DependencyInjection/Ioc.cs @@ -41,7 +41,7 @@ namespace CommunityToolkit.Mvvm.DependencyInjection; /// Ioc.Default.GetService<ILogger>().Log("Hello world!"); /// /// -public sealed class Ioc : IServiceProvider +public sealed partial class Ioc : IServiceProvider { /// /// Gets the default instance. diff --git a/src/CommunityToolkit.Mvvm/Input/AsyncRelayCommand.cs b/src/CommunityToolkit.Mvvm/Input/AsyncRelayCommand.cs index ed877ed52..e4e13cb89 100644 --- a/src/CommunityToolkit.Mvvm/Input/AsyncRelayCommand.cs +++ b/src/CommunityToolkit.Mvvm/Input/AsyncRelayCommand.cs @@ -20,7 +20,7 @@ namespace CommunityToolkit.Mvvm.Input; /// action, and providing an property that notifies changes when /// is invoked and when the returned completes. /// -public sealed class AsyncRelayCommand : IAsyncRelayCommand, ICancellationAwareCommand +public sealed partial class AsyncRelayCommand : IAsyncRelayCommand, ICancellationAwareCommand { /// /// The cached for . diff --git a/src/CommunityToolkit.Mvvm/Input/AsyncRelayCommand{T}.cs b/src/CommunityToolkit.Mvvm/Input/AsyncRelayCommand{T}.cs index a2b3d7f96..c0e0b3bf7 100644 --- a/src/CommunityToolkit.Mvvm/Input/AsyncRelayCommand{T}.cs +++ b/src/CommunityToolkit.Mvvm/Input/AsyncRelayCommand{T}.cs @@ -18,7 +18,7 @@ namespace CommunityToolkit.Mvvm.Input; /// A generic command that provides a more specific version of . /// /// The type of parameter being passed as input to the callbacks. -public sealed class AsyncRelayCommand : IAsyncRelayCommand, ICancellationAwareCommand +public sealed partial class AsyncRelayCommand : IAsyncRelayCommand, ICancellationAwareCommand { /// /// The to invoke when is used. diff --git a/src/CommunityToolkit.Mvvm/Input/Internals/CancelCommand.cs b/src/CommunityToolkit.Mvvm/Input/Internals/CancelCommand.cs index 70f6931ab..547ed1e12 100644 --- a/src/CommunityToolkit.Mvvm/Input/Internals/CancelCommand.cs +++ b/src/CommunityToolkit.Mvvm/Input/Internals/CancelCommand.cs @@ -11,7 +11,7 @@ namespace CommunityToolkit.Mvvm.Input.Internals; /// /// A implementation wrapping to support cancellation. /// -internal sealed class CancelCommand : ICommand +internal sealed partial class CancelCommand : ICommand { /// /// The wrapped instance. diff --git a/src/CommunityToolkit.Mvvm/Input/Internals/DisabledCommand.cs b/src/CommunityToolkit.Mvvm/Input/Internals/DisabledCommand.cs index f7f68f638..4e2f22eb1 100644 --- a/src/CommunityToolkit.Mvvm/Input/Internals/DisabledCommand.cs +++ b/src/CommunityToolkit.Mvvm/Input/Internals/DisabledCommand.cs @@ -10,7 +10,7 @@ namespace CommunityToolkit.Mvvm.Input.Internals; /// /// A reusable instance that is always disabled. /// -internal sealed class DisabledCommand : ICommand +internal sealed partial class DisabledCommand : ICommand { /// public event EventHandler? CanExecuteChanged diff --git a/src/CommunityToolkit.Mvvm/Input/RelayCommand.cs b/src/CommunityToolkit.Mvvm/Input/RelayCommand.cs index 42e0efdfb..cce8a7e00 100644 --- a/src/CommunityToolkit.Mvvm/Input/RelayCommand.cs +++ b/src/CommunityToolkit.Mvvm/Input/RelayCommand.cs @@ -16,7 +16,7 @@ namespace CommunityToolkit.Mvvm.Input; /// method is . This type does not allow you to accept command parameters /// in the and callback methods. /// -public sealed class RelayCommand : IRelayCommand +public sealed partial class RelayCommand : IRelayCommand { /// /// The to invoke when is used. diff --git a/src/CommunityToolkit.Mvvm/Input/RelayCommand{T}.cs b/src/CommunityToolkit.Mvvm/Input/RelayCommand{T}.cs index 66ca947a5..62f7cb9b0 100644 --- a/src/CommunityToolkit.Mvvm/Input/RelayCommand{T}.cs +++ b/src/CommunityToolkit.Mvvm/Input/RelayCommand{T}.cs @@ -18,7 +18,7 @@ namespace CommunityToolkit.Mvvm.Input; /// in the and callback methods. /// /// The type of parameter being passed as input to the callbacks. -public sealed class RelayCommand : IRelayCommand +public sealed partial class RelayCommand : IRelayCommand { /// /// The to invoke when is used. diff --git a/src/CommunityToolkit.Mvvm/Messaging/IMessengerExtensions.Observables.cs b/src/CommunityToolkit.Mvvm/Messaging/IMessengerExtensions.Observables.cs index 996e79be3..4675a3193 100644 --- a/src/CommunityToolkit.Mvvm/Messaging/IMessengerExtensions.Observables.cs +++ b/src/CommunityToolkit.Mvvm/Messaging/IMessengerExtensions.Observables.cs @@ -4,6 +4,14 @@ using System; +// This file has two types which implement interfaces that can be projected to WInRT, ie. +// 'Observable.Recipient' and 'Observable.Recipient', which +// implement 'IDisposable' (which is projected to 'IClosable'). These types are not meant +// to be used in interop scenarios (including in eg. bindings), as they're only meant to +// be used by code behind interacting with System.Reactive APIs. As such, we skip marking +// them partial, as we don't need CCW vtables to be generated for them. +#pragma warning disable CsWinRT1028 + namespace CommunityToolkit.Mvvm.Messaging; ///