Skip to content

Commit e575fac

Browse files
authored
Housekeeping Code Clean up (#244)
1 parent adbd74a commit e575fac

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) .NET Foundation and Contributors
3+
Copyright (c) ReactiveUI 2021 - 2025
44

55
All rights reserved.
66

src/ReactiveUI.Uno.WinUI/DispatcherQueueScheduler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace System.Reactive.Concurrency;
1313
/// <summary>
1414
/// Represents an object that schedules units of work on a <see cref="Microsoft.UI.Dispatching.DispatcherQueue"/>.
1515
/// </summary>
16-
public class DispatcherQueueScheduler : LocalScheduler, ISchedulerPeriodic
16+
public partial class DispatcherQueueScheduler : LocalScheduler, ISchedulerPeriodic
1717
{
1818
/// <summary>
1919
/// Gets the scheduler that schedules work on the <see cref="Microsoft.UI.Dispatching.DispatcherQueue"/> for the current thread.

src/ReactiveUI.Uno.WinUI/ReactiveUI.Uno.WinUI.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<PackageDescription>Contains the ReactiveUI platform specific extensions for Uno WinUI</PackageDescription>
66
<DefineConstants>$(DefineConstants);HAS_WINUI</DefineConstants>
77
<PackageTags>$(PackageTags);winui</PackageTags>
8+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
89
</PropertyGroup>
910

1011
<PropertyGroup Condition="$(TargetFramework.EndsWith('0-windows10.0.19041.0'))">

src/ReactiveUI.Uno/Common/AutoDataTemplateBindingHook.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ public class AutoDataTemplateBindingHook : IPropertyBindingHook
3131
public static Lazy<DataTemplate> DefaultItemTemplate { get; } = new(() =>
3232
{
3333
const string template =
34-
@"<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:xaml='using:ReactiveUI'>
35-
<xaml:ViewModelViewHost ViewModel=""{Binding}"" VerticalContentAlignment=""Stretch"" HorizontalContentAlignment=""Stretch"" IsTabStop=""False"" />
36-
</DataTemplate>";
34+
"""
35+
<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:xaml='using:ReactiveUI'>
36+
<xaml:ViewModelViewHost ViewModel="{Binding}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" IsTabStop="False" />
37+
</DataTemplate>
38+
""";
3739
return (DataTemplate)XamlReader.Load(template);
3840
});
3941

@@ -55,7 +57,7 @@ public bool ExecuteHook(object? source, object target, Func<IObservedChange<obje
5557
return true;
5658
}
5759

58-
if (viewProperties.Last().GetPropertyName() != "ItemsSource")
60+
if (viewProperties[^1].GetPropertyName() != "ItemsSource")
5961
{
6062
return true;
6163
}

src/ReactiveUI.Uno/Common/ReactivePage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public partial class ReactivePage<TViewModel> :
9090
/// </summary>
9191
public static readonly DependencyProperty ViewModelProperty =
9292
DependencyProperty.Register(
93-
"ViewModel",
93+
nameof(ViewModel),
9494
typeof(TViewModel),
9595
typeof(ReactivePage<TViewModel>),
9696
new PropertyMetadata(null));

src/ReactiveUI.Uno/Common/ReactiveUserControl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public partial class ReactiveUserControl<TViewModel> :
9090
/// </summary>
9191
public static readonly DependencyProperty ViewModelProperty =
9292
DependencyProperty.Register(
93-
"ViewModel",
93+
nameof(ViewModel),
9494
typeof(TViewModel),
9595
typeof(ReactiveUserControl<TViewModel>),
9696
new PropertyMetadata(null));

src/ReactiveUI.Uno/Common/RoutedViewHost.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,13 @@ public RoutedViewHost()
8686
(viewModel, contract) => (viewModel, contract));
8787

8888
this.WhenActivated(d =>
89-
{
89+
9090
// NB: The DistinctUntilChanged is useful because most views in
9191
// WinRT will end up getting here twice - once for configuring
9292
// the RoutedViewHost's ViewModel, and once on load via SizeChanged
9393
d(vmAndContract.DistinctUntilChanged<(IRoutableViewModel? viewModel, string? contract)>().Subscribe(
9494
ResolveViewForViewModel,
95-
ex => RxApp.DefaultExceptionHandler.OnNext(ex)));
96-
});
95+
ex => RxApp.DefaultExceptionHandler.OnNext(ex))));
9796
}
9897

9998
/// <summary>

src/ReactiveUI.Uno/TransitioningContentControl.Empty.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@ namespace ReactiveUI.Uno;
1414
/// <summary>
1515
/// A control with a single transition.
1616
/// </summary>
17-
public partial class TransitioningContentControl : ContentControl
18-
{
19-
}
17+
public partial class TransitioningContentControl : ContentControl;

0 commit comments

Comments
 (0)