Skip to content

Commit 2d7801e

Browse files
authored
Housekeeping - Update usings and namespaces (#3702)
<!-- Please be sure to read the [Contribute](https://github.com/reactiveui/reactiveui#contribute) section of the README --> **What kind of change does this PR introduce?** <!-- Bug fix, feature, docs update, ... --> Housekeeping **What is the current behavior?** <!-- You can also link to an open issue here. --> unused usings exist namespaces for maui using base ReactiveUI namespace **What is the new behavior?** <!-- If this is a feature change --> unused usings removed namespaces for ReactiveUI.Maui updated API packages updated and test amended as necessary - NO API actually changed, pure formatting update. **What might this PR break?** XAML includes using the ReactiveUI namespace will need to update to ReactiveUI.Maui to standardise across all controls. **Please check if the PR fulfills these requirements** - [ ] Tests for the changes have been added (for bug fixes / features) - [ ] Docs have been added / updated (for bug fixes / features) **Other information**: ---------
1 parent 845fb4d commit 2d7801e

14 files changed

+38
-60
lines changed

src/Directory.build.props

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<EmbedUntrackedSources>true</EmbedUntrackedSources>
3434
<IncludePackageReferencesDuringMarkupCompilation>true</IncludePackageReferencesDuringMarkupCompilation>
3535
<PublishRepositoryUrl>true</PublishRepositoryUrl>
36-
<XunitVersion>2.6.1</XunitVersion>
36+
<XunitVersion>2.6.4</XunitVersion>
3737
</PropertyGroup>
3838
<!--<PropertyGroup Condition="$(IsTestProject) != 'true'">
3939
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
@@ -52,13 +52,13 @@
5252
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
5353
<PackageReference Include="xunit" Version="$(XunitVersion)" />
5454
<PackageReference Include="xunit.runner.console" Version="$(XunitVersion)" />
55-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
55+
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6" />
5656
<PackageReference Include="Xunit.StaFact" Version="1.1.11" />
5757
<PackageReference Include="FluentAssertions" Version="6.12.0" />
5858
<PackageReference Include="Microsoft.Reactive.Testing" Version="6.0.0" />
59-
<PackageReference Include="PublicApiGenerator" Version="11.0.0" />
59+
<PackageReference Include="PublicApiGenerator" Version="11.1.0" />
6060
<PackageReference Include="coverlet.msbuild" Version="6.0.0" PrivateAssets="All" />
61-
<PackageReference Include="Verify.Xunit" Version="22.5.0" />
61+
<PackageReference Include="Verify.Xunit" Version="22.11.1" />
6262
</ItemGroup>
6363

6464
<ItemGroup Condition="'$(IsTestProject)' != 'true'">
@@ -77,8 +77,8 @@
7777

7878
<ItemGroup>
7979
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" PrivateAssets="all" />
80-
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.507" PrivateAssets="all" />
81-
<PackageReference Include="Roslynator.Analyzers" Version="4.6.2" PrivateAssets="All" />
80+
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.556" PrivateAssets="all" />
81+
<PackageReference Include="Roslynator.Analyzers" Version="4.7.0" PrivateAssets="All" />
8282
</ItemGroup>
8383
<ItemGroup>
8484
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />

src/ReactiveUI.Maui/Common/AutoDataTemplateBindingHook.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
// See the LICENSE file in the project root for full license information.
55

66
#if WINUI_TARGET
7-
using System;
8-
using System.Diagnostics.CodeAnalysis;
9-
using System.Linq;
107

118
using Microsoft.UI.Xaml;
129
using Microsoft.UI.Xaml.Controls;

src/ReactiveUI.Maui/Common/BooleanToVisibilityTypeConverter.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
using Microsoft.Maui;
1010
#endif
1111

12+
#if IS_MAUI
13+
namespace ReactiveUI.Maui;
14+
#else
1215
namespace ReactiveUI;
16+
#endif
1317

1418
/// <summary>
1519
/// This type convert converts between Boolean and XAML Visibility - the

src/ReactiveUI.Maui/Common/ReactivePage.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
using Microsoft.Maui.Controls;
1111
#endif
1212

13+
#if IS_MAUI
14+
namespace ReactiveUI.Maui;
15+
#else
1316
namespace ReactiveUI;
17+
#endif
1418

1519
/// <summary>
1620
/// A <see cref="Page"/> that is reactive.

src/ReactiveUI.Maui/Common/ReactiveUserControl.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
// See the LICENSE file in the project root for full license information.
55

66
#if WINUI_TARGET
7-
using System;
8-
using System.Diagnostics.CodeAnalysis;
9-
107
using Microsoft.UI.Xaml;
118
using Microsoft.UI.Xaml.Controls;
129

10+
#if IS_MAUI
11+
namespace ReactiveUI.Maui;
12+
#else
1313
namespace ReactiveUI;
14+
#endif
1415

1516
/// <summary>
1617
/// A <see cref="UserControl"/> that is reactive.

src/ReactiveUI.Maui/Common/ViewModelViewHost.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,7 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6-
#if WINUI_TARGET
7-
using System;
8-
using System.Diagnostics.CodeAnalysis;
9-
using System.Reactive;
10-
using System.Reactive.Disposables;
11-
using System.Reactive.Linq;
12-
136
using Microsoft.UI.Xaml;
14-
using Microsoft.UI.Xaml.Controls;
15-
16-
using Splat;
177

188
namespace ReactiveUI;
199

@@ -22,8 +12,7 @@ namespace ReactiveUI;
2212
/// the ViewModel property and display it. This control is very useful
2313
/// inside a DataTemplate to display the View associated with a ViewModel.
2414
/// </summary>
25-
public
26-
class ViewModelViewHost : TransitioningContentControl, IViewFor, IEnableLogger
15+
public class ViewModelViewHost : TransitioningContentControl, IViewFor, IEnableLogger
2716
{
2817
/// <summary>
2918
/// The default content dependency property.
@@ -158,4 +147,3 @@ private void ResolveViewForViewModel(object? viewModel, string? contract)
158147
Content = viewInstance;
159148
}
160149
}
161-
#endif

src/ReactiveUI.Maui/Registrations.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ public class Registrations : IWantsToRegisterStuff
2424
/// <inheritdoc/>
2525
public void Register(Action<Func<object>, Type> registerFunction)
2626
{
27-
if (registerFunction is null)
28-
{
29-
throw new ArgumentNullException(nameof(registerFunction));
30-
}
27+
ArgumentNullException.ThrowIfNull(registerFunction);
3128

3229
registerFunction(() => new ActivationForViewFetcher(), typeof(IActivationForViewFetcher));
3330
registerFunction(() => new BooleanToVisibilityTypeConverter(), typeof(IBindingTypeConverter));

src/ReactiveUI.Maui/WinUI/DependencyObjectObservableForProperty.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@
44
// See the LICENSE file in the project root for full license information.
55

66
#if WINUI_TARGET
7-
using System;
87
using System.Globalization;
8+
#if IS_MAUI
99
using System.Linq.Expressions;
10-
using System.Reactive.Disposables;
11-
using System.Reactive.Linq;
10+
#endif
1211
using System.Reflection;
13-
1412
using Microsoft.UI.Xaml;
1513

16-
using Splat;
17-
1814
namespace ReactiveUI;
1915

2016
/// <summary>

src/ReactiveUI.Maui/WinUI/DispatcherQueueScheduler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
// <auto-generated />
55

66
#if WINUI_TARGET
7-
using System.Reactive.Disposables;
7+
#if IS_MAUI
88
using System.Threading;
9+
#endif
910
using Microsoft.UI.Dispatching;
1011

1112
namespace System.Reactive.Concurrency;

src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.DotNet6_0.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,4 +1058,4 @@ namespace ReactiveUI
10581058
public static System.IObservable<TRet> WhenAnyObservable<TSender, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(this TSender? sender, System.Linq.Expressions.Expression<System.Func<TSender, System.IObservable<T1>?>> obs1, System.Linq.Expressions.Expression<System.Func<TSender, System.IObservable<T2>?>> obs2, System.Linq.Expressions.Expression<System.Func<TSender, System.IObservable<T3>?>> obs3, System.Linq.Expressions.Expression<System.Func<TSender, System.IObservable<T4>?>> obs4, System.Linq.Expressions.Expression<System.Func<TSender, System.IObservable<T5>?>> obs5, System.Linq.Expressions.Expression<System.Func<TSender, System.IObservable<T6>?>> obs6, System.Linq.Expressions.Expression<System.Func<TSender, System.IObservable<T7>?>> obs7, System.Linq.Expressions.Expression<System.Func<TSender, System.IObservable<T8>?>> obs8, System.Linq.Expressions.Expression<System.Func<TSender, System.IObservable<T9>?>> obs9, System.Linq.Expressions.Expression<System.Func<TSender, System.IObservable<T10>?>> obs10, System.Linq.Expressions.Expression<System.Func<TSender, System.IObservable<T11>?>> obs11, System.Linq.Expressions.Expression<System.Func<TSender, System.IObservable<T12>?>> obs12, System.Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, T9?, T10?, T11?, T12?, TRet> selector)
10591059
where TSender : class { }
10601060
}
1061-
}
1061+
}

0 commit comments

Comments
 (0)