diff --git a/src/Directory.build.props b/src/Directory.build.props index 170ce04c82..497faf6099 100644 --- a/src/Directory.build.props +++ b/src/Directory.build.props @@ -45,15 +45,15 @@ - - - + + + - + diff --git a/src/ReactiveUI.AndroidX/ReactiveUI.AndroidX.csproj b/src/ReactiveUI.AndroidX/ReactiveUI.AndroidX.csproj index 57a4bcbfe2..ba29ef3477 100644 --- a/src/ReactiveUI.AndroidX/ReactiveUI.AndroidX.csproj +++ b/src/ReactiveUI.AndroidX/ReactiveUI.AndroidX.csproj @@ -16,11 +16,11 @@ - - - - - + + + + + diff --git a/src/ReactiveUI.Blazor/ReactiveUI.Blazor.csproj b/src/ReactiveUI.Blazor/ReactiveUI.Blazor.csproj index 3c3f5ad701..fd58aec358 100644 --- a/src/ReactiveUI.Blazor/ReactiveUI.Blazor.csproj +++ b/src/ReactiveUI.Blazor/ReactiveUI.Blazor.csproj @@ -1,4 +1,4 @@ - + netstandard2.0;net6.0;net7.0 Contains the ReactiveUI platform specific extensions for Blazor @@ -15,11 +15,11 @@ - + - + diff --git a/src/ReactiveUI.Drawing/ReactiveUI.Drawing.csproj b/src/ReactiveUI.Drawing/ReactiveUI.Drawing.csproj index 6842672dee..87572c073e 100644 --- a/src/ReactiveUI.Drawing/ReactiveUI.Drawing.csproj +++ b/src/ReactiveUI.Drawing/ReactiveUI.Drawing.csproj @@ -6,7 +6,13 @@ ReactiveUI.Drawing A extension to the ReactiveUI platform that provides Splat bitmap operation support. ReactiveUI.Drawing - + 14.2 + 14.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + diff --git a/src/ReactiveUI.Fody.Analyzer.Test/ReactiveUI.Fody.Analyzer.Tests.csproj b/src/ReactiveUI.Fody.Analyzer.Test/ReactiveUI.Fody.Analyzer.Tests.csproj index 6358dd0ab5..0d6669bd85 100644 --- a/src/ReactiveUI.Fody.Analyzer.Test/ReactiveUI.Fody.Analyzer.Tests.csproj +++ b/src/ReactiveUI.Fody.Analyzer.Test/ReactiveUI.Fody.Analyzer.Tests.csproj @@ -1,6 +1,6 @@ - + - net462;net6.0 + net472;net6.0 false diff --git a/src/ReactiveUI.Fody.Tests/ApiApprovalBase.cs b/src/ReactiveUI.Fody.Tests/ApiApprovalBase.cs index 0b2d4298c1..f9ea10f18a 100644 --- a/src/ReactiveUI.Fody.Tests/ApiApprovalBase.cs +++ b/src/ReactiveUI.Fody.Tests/ApiApprovalBase.cs @@ -19,7 +19,11 @@ /// Tests for API approvals. /// [ExcludeFromCodeCoverage] +#pragma warning disable CA1050 // Declare types in namespaces +#pragma warning disable RCS1110 // Declare type inside namespace. public abstract class ApiApprovalBase +#pragma warning restore RCS1110 // Declare type inside namespace. +#pragma warning restore CA1050 // Declare types in namespaces { /// /// Checks the assembly to detect the public API. Generates a received/approved version of the API. diff --git a/src/ReactiveUI.Fody.Tests/ReactiveUI.Fody.Tests.csproj b/src/ReactiveUI.Fody.Tests/ReactiveUI.Fody.Tests.csproj index ed3a281bf8..5521425842 100644 --- a/src/ReactiveUI.Fody.Tests/ReactiveUI.Fody.Tests.csproj +++ b/src/ReactiveUI.Fody.Tests/ReactiveUI.Fody.Tests.csproj @@ -1,6 +1,6 @@ - + - net462;net6.0 + net472;net6.0 netstandard2.0 false diff --git a/src/ReactiveUI.LeakTests/ReactiveUI.LeakTests.csproj b/src/ReactiveUI.LeakTests/ReactiveUI.LeakTests.csproj index e33738b019..4c412c56bf 100644 --- a/src/ReactiveUI.LeakTests/ReactiveUI.LeakTests.csproj +++ b/src/ReactiveUI.LeakTests/ReactiveUI.LeakTests.csproj @@ -1,6 +1,6 @@ - + - net462;net6.0 + net472;net6.0 false diff --git a/src/ReactiveUI.Splat.Tests/ReactiveUI.Splat.Tests.csproj b/src/ReactiveUI.Splat.Tests/ReactiveUI.Splat.Tests.csproj index 1fa0881d59..5580c54709 100644 --- a/src/ReactiveUI.Splat.Tests/ReactiveUI.Splat.Tests.csproj +++ b/src/ReactiveUI.Splat.Tests/ReactiveUI.Splat.Tests.csproj @@ -1,7 +1,7 @@ - + - net462;net6.0 + net472;net6.0 false diff --git a/src/ReactiveUI.Testing.Tests/ReactiveUI.Testing.Tests.csproj b/src/ReactiveUI.Testing.Tests/ReactiveUI.Testing.Tests.csproj index 409d251d7e..54d66025e6 100644 --- a/src/ReactiveUI.Testing.Tests/ReactiveUI.Testing.Tests.csproj +++ b/src/ReactiveUI.Testing.Tests/ReactiveUI.Testing.Tests.csproj @@ -1,6 +1,6 @@ - + - net462;net6.0 + net472;net6.0 netstandard2.0 $(TargetFramework) diff --git a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.DotNet6_0.verified.txt b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.DotNet6_0.verified.txt index dd5f9aca7c..a104db919a 100644 --- a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.DotNet6_0.verified.txt +++ b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.DotNet6_0.verified.txt @@ -63,7 +63,8 @@ namespace ReactiveUI public static class ChangeSetMixin { public static System.IObservable CountChanged(this System.IObservable changeSet) { } - public static System.IObservable> CountChanged(this System.IObservable> changeSet) { } + public static System.IObservable> CountChanged(this System.IObservable> changeSet) + where T : notnull { } public static bool HasCountChanged(this DynamicData.IChangeSet changeSet) { } } public class CombinedReactiveCommand : ReactiveUI.ReactiveCommandBase> @@ -799,13 +800,13 @@ namespace ReactiveUI { public RoutingState(System.Reactive.Concurrency.IScheduler? scheduler = null) { } [System.Runtime.Serialization.IgnoreDataMember] - public System.IObservable CurrentViewModel { get; set; } + public System.IObservable CurrentViewModel { get; set; } [System.Runtime.Serialization.IgnoreDataMember] public ReactiveUI.ReactiveCommand Navigate { get; set; } [System.Runtime.Serialization.IgnoreDataMember] public ReactiveUI.ReactiveCommand NavigateAndReset { get; set; } [System.Runtime.Serialization.IgnoreDataMember] - public ReactiveUI.ReactiveCommand NavigateBack { get; set; } + public ReactiveUI.ReactiveCommand NavigateBack { get; set; } [System.Runtime.Serialization.IgnoreDataMember] public System.IObservable> NavigationChanged { get; set; } [System.Runtime.Serialization.DataMember] diff --git a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.DotNet7_0.verified.txt b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.DotNet7_0.verified.txt index 66fefa6663..6c11f4cc3d 100644 --- a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.DotNet7_0.verified.txt +++ b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.DotNet7_0.verified.txt @@ -63,7 +63,8 @@ namespace ReactiveUI public static class ChangeSetMixin { public static System.IObservable CountChanged(this System.IObservable changeSet) { } - public static System.IObservable> CountChanged(this System.IObservable> changeSet) { } + public static System.IObservable> CountChanged(this System.IObservable> changeSet) + where T : notnull { } public static bool HasCountChanged(this DynamicData.IChangeSet changeSet) { } } public class CombinedReactiveCommand : ReactiveUI.ReactiveCommandBase> @@ -799,13 +800,13 @@ namespace ReactiveUI { public RoutingState(System.Reactive.Concurrency.IScheduler? scheduler = null) { } [System.Runtime.Serialization.IgnoreDataMember] - public System.IObservable CurrentViewModel { get; set; } + public System.IObservable CurrentViewModel { get; set; } [System.Runtime.Serialization.IgnoreDataMember] public ReactiveUI.ReactiveCommand Navigate { get; set; } [System.Runtime.Serialization.IgnoreDataMember] public ReactiveUI.ReactiveCommand NavigateAndReset { get; set; } [System.Runtime.Serialization.IgnoreDataMember] - public ReactiveUI.ReactiveCommand NavigateBack { get; set; } + public ReactiveUI.ReactiveCommand NavigateBack { get; set; } [System.Runtime.Serialization.IgnoreDataMember] public System.IObservable> NavigationChanged { get; set; } [System.Runtime.Serialization.DataMember] diff --git a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.Net4_7.verified.txt b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.Net4_7.verified.txt index bfa32e2552..ff2070b3ec 100644 --- a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.Net4_7.verified.txt +++ b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.Net4_7.verified.txt @@ -61,7 +61,8 @@ namespace ReactiveUI public static class ChangeSetMixin { public static System.IObservable CountChanged(this System.IObservable changeSet) { } - public static System.IObservable> CountChanged(this System.IObservable> changeSet) { } + public static System.IObservable> CountChanged(this System.IObservable> changeSet) + where T : notnull { } public static bool HasCountChanged(this DynamicData.IChangeSet changeSet) { } } public class CombinedReactiveCommand : ReactiveUI.ReactiveCommandBase> @@ -804,13 +805,13 @@ namespace ReactiveUI { public RoutingState(System.Reactive.Concurrency.IScheduler? scheduler = null) { } [System.Runtime.Serialization.IgnoreDataMember] - public System.IObservable CurrentViewModel { get; set; } + public System.IObservable CurrentViewModel { get; set; } [System.Runtime.Serialization.IgnoreDataMember] public ReactiveUI.ReactiveCommand Navigate { get; set; } [System.Runtime.Serialization.IgnoreDataMember] public ReactiveUI.ReactiveCommand NavigateAndReset { get; set; } [System.Runtime.Serialization.IgnoreDataMember] - public ReactiveUI.ReactiveCommand NavigateBack { get; set; } + public ReactiveUI.ReactiveCommand NavigateBack { get; set; } [System.Runtime.Serialization.IgnoreDataMember] public System.IObservable> NavigationChanged { get; set; } [System.Runtime.Serialization.DataMember] diff --git a/src/ReactiveUI.Tests/AwaiterTest.cs b/src/ReactiveUI.Tests/AwaiterTest.cs index 2c683d3782..e5b3ec7468 100644 --- a/src/ReactiveUI.Tests/AwaiterTest.cs +++ b/src/ReactiveUI.Tests/AwaiterTest.cs @@ -16,6 +16,7 @@ public class AwaiterTest /// A smoke test for Awaiters. /// [Fact] + [SuppressMessage("Usage", "xUnit1031:Do not use blocking task operations in test method", Justification = "Intentional")] public void AwaiterSmokeTest() { var fixture = AwaitAnObservable(); diff --git a/src/ReactiveUI.XamForms/ReactiveUI.XamForms.csproj b/src/ReactiveUI.XamForms/ReactiveUI.XamForms.csproj index 7344c950af..b9a2d6c41a 100644 --- a/src/ReactiveUI.XamForms/ReactiveUI.XamForms.csproj +++ b/src/ReactiveUI.XamForms/ReactiveUI.XamForms.csproj @@ -1,4 +1,4 @@ - + netstandard2.0;net6.0;net7.0 Contains the ReactiveUI platform specific extensions for Xamarin Forms @@ -7,7 +7,7 @@ - + diff --git a/src/ReactiveUI/Mixins/ChangeSetMixin.cs b/src/ReactiveUI/Mixins/ChangeSetMixin.cs index d612a699b4..ec9d56b319 100644 --- a/src/ReactiveUI/Mixins/ChangeSetMixin.cs +++ b/src/ReactiveUI/Mixins/ChangeSetMixin.cs @@ -40,5 +40,7 @@ public static class ChangeSetMixin /// The change set type. /// The change list to evaluate. /// An observable of changes that only have count changes. - public static IObservable> CountChanged(this IObservable> changeSet) => changeSet.Where(x => x.HasCountChanged()); // TODO: Create Test -} \ No newline at end of file + public static IObservable> CountChanged(this IObservable> changeSet) + where T : notnull => + changeSet.Where(x => x.HasCountChanged()); // TODO: Create Test +} diff --git a/src/ReactiveUI/ReactiveUI.csproj b/src/ReactiveUI/ReactiveUI.csproj index a25cfdfe40..f6c139e4c8 100644 --- a/src/ReactiveUI/ReactiveUI.csproj +++ b/src/ReactiveUI/ReactiveUI.csproj @@ -7,8 +7,14 @@ A MVVM framework that integrates with the Reactive Extensions for .NET to create elegant, testable User Interfaces that run on any mobile or desktop platform. This is the base package with the base platform implementations ReactiveUI - $(NoWarn);SYSLIB0011;IDE1006; - + $(NoWarn);SYSLIB0011;IDE1006 + 14.2 + 14.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + @@ -123,7 +129,7 @@ - + diff --git a/src/ReactiveUI/Routing/RoutingState.cs b/src/ReactiveUI/Routing/RoutingState.cs index abcd5063d9..3092a0e430 100644 --- a/src/ReactiveUI/Routing/RoutingState.cs +++ b/src/ReactiveUI/Routing/RoutingState.cs @@ -19,7 +19,6 @@ namespace ReactiveUI; [DataContract] public class RoutingState : ReactiveObject { - [IgnoreDataMember] private readonly IScheduler _scheduler; @@ -50,7 +49,7 @@ public RoutingState(IScheduler? scheduler = null) /// Gets or sets a command which will navigate back to the previous element in the stack. /// [IgnoreDataMember] - public ReactiveCommand NavigateBack { get; protected set; } + public ReactiveCommand NavigateBack { get; protected set; } /// /// Gets or sets a command that navigates to the a new element in the stack - the Execute parameter @@ -72,7 +71,7 @@ public RoutingState(IScheduler? scheduler = null) /// Gets or sets the current view model which is to be shown for the Routing. /// [IgnoreDataMember] - public IObservable CurrentViewModel { get; protected set; } + public IObservable CurrentViewModel { get; protected set; } /// /// Gets or sets an observable which will signal when the Navigation changes. @@ -81,7 +80,11 @@ public RoutingState(IScheduler? scheduler = null) public IObservable> NavigationChanged { get; protected set; } // TODO: Create Test [OnDeserialized] +#pragma warning disable RCS1163 // Unused parameter. +#pragma warning disable RCS1231 // Make parameter ref read-only. private void SetupRx(StreamingContext sc) => SetupRx(); +#pragma warning restore RCS1231 // Make parameter ref read-only. +#pragma warning restore RCS1163 // Unused parameter. private void SetupRx() { @@ -90,13 +93,13 @@ private void SetupRx() var countAsBehavior = Observable.Defer(() => Observable.Return(NavigationStack.Count)).Concat(NavigationChanged.CountChanged().Select(_ => NavigationStack.Count)); NavigateBack = - ReactiveCommand.CreateFromObservable( - () => - { - NavigationStack.RemoveAt(NavigationStack.Count - 1); - return Observable.Return(NavigationStack.Count > 0 ? NavigationStack[NavigationStack.Count - 1] : default).ObserveOn(navigateScheduler); - }, - countAsBehavior.Select(x => x > 1)); + ReactiveCommand.CreateFromObservable( + () => + { + NavigationStack.RemoveAt(NavigationStack.Count - 1); + return Observable.Return(NavigationStack.Count > 0 ? NavigationStack[NavigationStack.Count - 1] : default!).ObserveOn(navigateScheduler); + }, + countAsBehavior.Select(x => x > 1)); Navigate = ReactiveCommand.CreateFromObservable( vm => @@ -117,6 +120,6 @@ private void SetupRx() return Navigate.Execute(vm); }); - CurrentViewModel = Observable.Defer(() => Observable.Return(NavigationStack.LastOrDefault())).Concat(NavigationChanged.Select(_ => NavigationStack.LastOrDefault())); + CurrentViewModel = Observable.Defer(() => Observable.Return(NavigationStack.LastOrDefault()!)).Concat(NavigationChanged.Select(_ => NavigationStack.LastOrDefault()!)); } } diff --git a/version.json b/version.json index 012f6e6ef4..a8c8b39baa 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "19.4", + "version": "19.5", "publicReleaseRefSpec": [ "^refs/heads/master$", // we release out of master "^refs/heads/main$",