diff --git a/Toolkit.Avalonia/ClassicDesktopStyleApplicationHandler.cs b/Toolkit.Avalonia/ClassicDesktopStyleApplicationHandler.cs index 9a43001..34af12b 100644 --- a/Toolkit.Avalonia/ClassicDesktopStyleApplicationHandler.cs +++ b/Toolkit.Avalonia/ClassicDesktopStyleApplicationHandler.cs @@ -6,9 +6,9 @@ using Toolkit.Foundation; namespace Toolkit.Avalonia; public class ClassicDesktopStyleApplicationHandler : - IHandler> + IHandler { - public void Handle(NavigateEventArgs args) + public void Handle(NavigateTemplateEventArgs args) { if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime lifeTime) diff --git a/Toolkit.Avalonia/ContentControlHandler.cs b/Toolkit.Avalonia/ContentControlHandler.cs index 5cebbf3..ca734ac 100644 --- a/Toolkit.Avalonia/ContentControlHandler.cs +++ b/Toolkit.Avalonia/ContentControlHandler.cs @@ -5,9 +5,9 @@ using Toolkit.Foundation; namespace Toolkit.Avalonia; public class ContentControlHandler : - IHandler> + IHandler { - public void Handle(NavigateEventArgs args) + public void Handle(NavigateTemplateEventArgs args) { if (args.Region is ContentControl contentControl) { diff --git a/Toolkit.Avalonia/ContentDialogHandler.cs b/Toolkit.Avalonia/ContentDialogHandler.cs index 8033e73..f269bd6 100644 --- a/Toolkit.Avalonia/ContentDialogHandler.cs +++ b/Toolkit.Avalonia/ContentDialogHandler.cs @@ -5,9 +5,9 @@ using Toolkit.UI.Controls.Avalonia; namespace Toolkit.Avalonia; public class ContentDialogHandler : - IHandler> + IHandler { - public async void Handle(NavigateEventArgs args) + public async void Handle(NavigateTemplateEventArgs args) { if (args.Template is ContentDialog dialog) { diff --git a/Toolkit.Avalonia/FrameHandler.cs b/Toolkit.Avalonia/FrameHandler.cs index dda22b8..7a65c6a 100644 --- a/Toolkit.Avalonia/FrameHandler.cs +++ b/Toolkit.Avalonia/FrameHandler.cs @@ -8,10 +8,10 @@ using Toolkit.UI.Controls.Avalonia; namespace Toolkit.Avalonia; public class FrameHandler(ITransientNavigationStore navigationStore) : - IHandler>, + IHandler, IHandler> { - public void Handle(NavigateEventArgs args) + public void Handle(NavigateTemplateEventArgs args) { if (args.Region is Frame frame) { diff --git a/Toolkit.Avalonia/IServiceCollectionExtensions.cs b/Toolkit.Avalonia/IServiceCollectionExtensions.cs index 21a7b65..e9b329a 100644 --- a/Toolkit.Avalonia/IServiceCollectionExtensions.cs +++ b/Toolkit.Avalonia/IServiceCollectionExtensions.cs @@ -30,16 +30,16 @@ public static class IServiceCollectionExtensions services.AddAsyncHandler, IReadOnlyCollection?, SelectFoldersHandler>(); services.AddAsyncHandler, IReadOnlyCollection?, SelectFilesHandler>(); - services.AddHandler, ClassicDesktopStyleApplicationHandler>(nameof(IClassicDesktopStyleApplicationLifetime)); - services.AddHandler, SingleViewApplicationHandler>(nameof(ISingleViewApplicationLifetime)); + services.AddHandler(nameof(IClassicDesktopStyleApplicationLifetime)); + services.AddHandler(nameof(ISingleViewApplicationLifetime)); - services.AddHandler, ContentControlHandler>(nameof(ContentControl)); + services.AddHandler(nameof(ContentControl)); - services.AddHandler, FrameHandler>(nameof(Frame)); + services.AddHandler(nameof(Frame)); services.TryAddSingleton, TransientNavigationStore>(); - services.AddHandler, ContentDialogHandler>(nameof(ContentDialog)); - services.AddHandler, TaskDialogHandler>(nameof(TaskDialog)); + services.AddHandler(nameof(ContentDialog)); + services.AddHandler(nameof(TaskDialog)); services.AddScoped(provider => new NavigationRegionCollection { @@ -69,13 +69,13 @@ public static class IServiceCollectionExtensions services.AddAsyncHandler, IReadOnlyCollection?, SelectFoldersHandler>(); services.AddAsyncHandler, IReadOnlyCollection?, SelectFilesHandler>(); - services.AddHandler, ContentControlHandler>(nameof(ContentControl)); + services.AddHandler(nameof(ContentControl)); - services.AddHandler, FrameHandler>(nameof(Frame)); + services.AddHandler(nameof(Frame)); services.TryAddSingleton, TransientNavigationStore>(); - services.AddHandler, ContentDialogHandler>(nameof(ContentDialog)); - services.AddHandler, TaskDialogHandler>(nameof(TaskDialog)); + services.AddHandler(nameof(ContentDialog)); + services.AddHandler(nameof(TaskDialog)); }))); return services; diff --git a/Toolkit.Avalonia/SingleViewApplicationHandler.cs b/Toolkit.Avalonia/SingleViewApplicationHandler.cs index d6b213a..fb3634a 100644 --- a/Toolkit.Avalonia/SingleViewApplicationHandler.cs +++ b/Toolkit.Avalonia/SingleViewApplicationHandler.cs @@ -6,9 +6,9 @@ using Toolkit.Foundation; namespace Toolkit.Avalonia; public class SingleViewApplicationHandler : - IHandler> + IHandler { - public void Handle(NavigateEventArgs args) + public void Handle(NavigateTemplateEventArgs args) { if (Application.Current?.ApplicationLifetime is ISingleViewApplicationLifetime lifeTime) diff --git a/Toolkit.Avalonia/TaskDialogHandler.cs b/Toolkit.Avalonia/TaskDialogHandler.cs index c4eeb6e..660393a 100644 --- a/Toolkit.Avalonia/TaskDialogHandler.cs +++ b/Toolkit.Avalonia/TaskDialogHandler.cs @@ -6,9 +6,9 @@ using Toolkit.UI.Controls.Avalonia; namespace Toolkit.Avalonia; public class TaskDialogHandler(ITopLevelProvider topLevelProvider) : - IHandler> + IHandler { - public async void Handle(NavigateEventArgs args) + public async void Handle(NavigateTemplateEventArgs args) { if (args.Template is TaskDialog dialog) { diff --git a/Toolkit.Foundation/ContentFactory.cs b/Toolkit.Foundation/ContentFactory.cs index 1b9d231..a0d5f33 100644 --- a/Toolkit.Foundation/ContentFactory.cs +++ b/Toolkit.Foundation/ContentFactory.cs @@ -5,7 +5,7 @@ public class ContentFactory(IServiceProvider provider, IContentFactory { public object? Create(IContentTemplateDescriptor descriptor, - object[] parameters) + object?[] parameters) { object? content = parameters is { Length: > 0 } ? factory.Create(descriptor.ContentType, args => diff --git a/Toolkit.Foundation/IContentFactory.cs b/Toolkit.Foundation/IContentFactory.cs index cb172d2..fedb247 100644 --- a/Toolkit.Foundation/IContentFactory.cs +++ b/Toolkit.Foundation/IContentFactory.cs @@ -3,6 +3,6 @@ public interface IContentFactory { object? Create(IContentTemplateDescriptor descriptor, - object[] parameters); + object?[] parameters); } } \ No newline at end of file diff --git a/Toolkit.Foundation/NavigateEventArgs.cs b/Toolkit.Foundation/NavigateEventArgs.cs index 62665f7..ced7baf 100644 --- a/Toolkit.Foundation/NavigateEventArgs.cs +++ b/Toolkit.Foundation/NavigateEventArgs.cs @@ -7,7 +7,8 @@ public record NavigateEventArgs(string Route, EventHandler? Navigated = null, IDictionary? Parameters = null); -public record NavigateEventArgs(object Region, + +public record NavigateTemplateEventArgs(object Region, object Template, object Content, object? Sender = null, diff --git a/Toolkit.Foundation/Navigation.cs b/Toolkit.Foundation/Navigation.cs index e5d05be..f2ef62b 100644 --- a/Toolkit.Foundation/Navigation.cs +++ b/Toolkit.Foundation/Navigation.cs @@ -32,13 +32,17 @@ public class Navigation(IServiceProvider provider, is IContentTemplateDescriptor descriptor) { Dictionary? arguments = parameters?.ToDictionary(x => x.Key, x => x.Value, StringComparer.InvariantCultureIgnoreCase) ?? []; - object[]? resolvedArguments = parameters is not null ? [.. descriptor.ContentType - .GetConstructors() - .FirstOrDefault()? - .GetParameters() - .Select(x => x?.Name is not null && arguments - .TryGetValue(x.Name, out object? argument) ? argument : default) - .Where(argument => argument is not null)] : []; + object?[] resolvedArguments = parameters is not null + ? descriptor.ContentType + .GetConstructors() + .FirstOrDefault()? + .GetParameters() + .Select(x => + x?.Name is not null && arguments is not null && arguments.TryGetValue(x.Name, out object? argument) + ? argument + : null) + .Where(argument => argument is not null) + .ToArray() ?? [] : []; if (provider.GetRequiredKeyedService(descriptor.TemplateType, descriptor.Key) is object template) @@ -67,16 +71,11 @@ public class Navigation(IServiceProvider provider, if (content is not null) { Type navigationType = region is Type type ? type : region.GetType(); - Type navigateEventType = typeof(NavigateEventArgs<>).MakeGenericType(navigationType); - if (Activator.CreateInstance(navigateEventType, [region, template, content, sender, parameters]) - is object navigateEvent) + messenger.Send(new NavigateTemplateEventArgs(region, template, content, sender, parameters), navigationType.Name); + if (currentSegmentIndex == segmentCount) { - messenger.Send(navigateEvent, navigationType.Name); - if (currentSegmentIndex == segmentCount) - { - navigated?.Invoke(this, EventArgs.Empty); - } + navigated?.Invoke(this, EventArgs.Empty); } } } diff --git a/Toolkit.Foundation/Observable.cs b/Toolkit.Foundation/Observable.cs index 2a51894..b5b1423 100644 --- a/Toolkit.Foundation/Observable.cs +++ b/Toolkit.Foundation/Observable.cs @@ -24,7 +24,7 @@ public partial class Observable(IServiceProvider provider, public IServiceProvider Provider { get; } = provider; - public IMessenger Messenger { get; } = messenger; + public new IMessenger Messenger { get; } = messenger; public void Commit() { diff --git a/Toolkit.UI.Avalonia/NavigateRegionAction.cs b/Toolkit.UI.Avalonia/NavigateRegionAction.cs index b497ac0..182c763 100644 --- a/Toolkit.UI.Avalonia/NavigateRegionAction.cs +++ b/Toolkit.UI.Avalonia/NavigateRegionAction.cs @@ -35,7 +35,8 @@ public class NavigateRegionAction : { if (control.DataContext is IObservableViewModel observableViewModel) { - if (observableViewModel.Provider.GetRequiredService() is INavigationRegion navigationRegion) + if (observableViewModel.Provider.GetRequiredService() + is INavigationRegion navigationRegion) { navigationRegion.Register(Name, sender); Interaction.ExecuteActions(sender, Actions, parameter); diff --git a/Toolkit.UI.WinUI/AttachedBehaviour.cs b/Toolkit.UI.WinUI/AttachedBehaviour.cs new file mode 100644 index 0000000..717c035 --- /dev/null +++ b/Toolkit.UI.WinUI/AttachedBehaviour.cs @@ -0,0 +1,13 @@ +using Microsoft.Xaml.Interactivity; + +namespace Toolkit.UI.WinUI; + +public class AttachedBehaviour : + Trigger +{ + protected override void OnAttached() + { + Interaction.ExecuteActions(AssociatedObject, Actions, null); + base.OnAttached(); + } +} \ No newline at end of file diff --git a/Toolkit.UI.WinUI/NavigateAction.cs b/Toolkit.UI.WinUI/NavigateAction.cs new file mode 100644 index 0000000..e05d488 --- /dev/null +++ b/Toolkit.UI.WinUI/NavigateAction.cs @@ -0,0 +1,84 @@ +using CommunityToolkit.Mvvm.Messaging; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.Xaml.Interactivity; +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using Toolkit.Foundation; +using Toolkit.WinUI; +using Windows.UI.Xaml.Markup; + +namespace Toolkit.UI.WinUI; + +[ContentProperty(Name = nameof(Parameters))] +public class NavigateAction : + DependencyObject, + IAction +{ + public static readonly DependencyProperty RegionProperty = + DependencyProperty.Register(nameof(Region), + typeof(object), typeof(NavigateAction), + new PropertyMetadata(null)); + + public static readonly DependencyProperty RouteProperty = + DependencyProperty.Register(nameof(Route), + typeof(string), typeof(NavigateAction), + new PropertyMetadata(null)); + + public static readonly DependencyProperty ScopeProperty = + DependencyProperty.Register(nameof(Scope), + typeof(string), typeof(NavigateAction), + new PropertyMetadata(null)); + + public static readonly DependencyProperty ParametersProperty = + DependencyProperty.Register(nameof(Parameters), + typeof(ParameterCollection), typeof(NavigateAction), + new PropertyMetadata(null)); + + private ParameterCollection parameterCollection = []; + + public event EventHandler? Navigated; + + public object Region + { + get => GetValue(RegionProperty); + set => SetValue(RegionProperty, value); + } + + public ParameterCollection Parameters => + parameterCollection ??= []; + + public string Route + { + get => (string)GetValue(RouteProperty); + set => SetValue(RouteProperty, value); + } + + public string Scope + { + get => (string)GetValue(ScopeProperty); + set => SetValue(ScopeProperty, value); + } + + public object Execute(object? sender, + object? parameter) + { + if (sender is Control content) + { + Dictionary arguments = + new(StringComparer.InvariantCultureIgnoreCase); + + if (content.DataContext is IObservableViewModel observableViewModel) + { + ImmutableDictionary? parameters = Parameters is { Count: > 0 } ? Parameters.ToImmutableDictionary(x => x.Key, x => x.Value) : + ImmutableDictionary.Empty; + + observableViewModel.Messenger.Send(new NavigateEventArgs(Route, Region.Equals(this) ? content : Region, Scope ?? null, + content.DataContext, Navigated, parameters)); + } + } + + return true; + } +} \ No newline at end of file diff --git a/Toolkit.UI.WinUI/NavigateRegionAction.cs b/Toolkit.UI.WinUI/NavigateRegionAction.cs new file mode 100644 index 0000000..58c9337 --- /dev/null +++ b/Toolkit.UI.WinUI/NavigateRegionAction.cs @@ -0,0 +1,53 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.Xaml.Interactivity; +using Toolkit.Foundation; +using Windows.UI.Xaml.Markup; + +namespace Toolkit.UI.WinUI; + +[ContentProperty(Name = nameof(Actions))] +public class NavigateRegionAction : + DependencyObject, + IAction +{ + public static readonly DependencyProperty ActionsProperty = + DependencyProperty.Register(nameof(Actions), + typeof(ActionCollection), typeof(NavigateRegionAction), + new PropertyMetadata(null)); + + public static readonly DependencyProperty NameProperty = + DependencyProperty.Register(nameof(Name), + typeof(string), typeof(NavigateRegionAction), + new PropertyMetadata(null)); + + private ActionCollection? actions; + + public ActionCollection Actions => actions ??= []; + + public string Name + { + get => (string)GetValue(NameProperty); + set => SetValue(NameProperty, value); + } + + public object? Execute(object? sender, + object? parameter) + { + if (sender is Control control) + { + if (control.DataContext is IObservableViewModel observableViewModel) + { + if (observableViewModel.Provider.GetRequiredService() + is INavigationRegion navigationRegion) + { + navigationRegion.Register(Name, sender); + Interaction.ExecuteActions(sender, Actions, parameter); + } + } + } + + return true; + } +} diff --git a/Toolkit.UI.WinUI/Parameter.cs b/Toolkit.UI.WinUI/Parameter.cs new file mode 100644 index 0000000..3d8fb8d --- /dev/null +++ b/Toolkit.UI.WinUI/Parameter.cs @@ -0,0 +1,30 @@ +using Microsoft.UI.Xaml; +using System.Xml.Linq; + +namespace Toolkit.WinUI; + +public class Parameter : + DependencyObject +{ + public static readonly DependencyProperty KeyProperty = + DependencyProperty.Register(nameof(Key), + typeof(object), typeof(Parameter), + new PropertyMetadata(null)); + + public static readonly DependencyProperty ValueProperty = + DependencyProperty.Register(nameof(Value), + typeof(string), typeof(Parameter), + new PropertyMetadata(null)); + + public string Key + { + get => (string)GetValue(KeyProperty); + set => SetValue(KeyProperty, value); + } + + public object Value + { + get => GetValue(ValueProperty); + set => SetValue(ValueProperty, value); + } +} \ No newline at end of file diff --git a/Toolkit.UI.WinUI/ParameterCollection.cs b/Toolkit.UI.WinUI/ParameterCollection.cs new file mode 100644 index 0000000..3cff770 --- /dev/null +++ b/Toolkit.UI.WinUI/ParameterCollection.cs @@ -0,0 +1,6 @@ +using System.Collections.ObjectModel; + +namespace Toolkit.WinUI; + +public class ParameterCollection : + ObservableCollection; \ No newline at end of file diff --git a/Toolkit.UI.WinUI/Toolkit.UI.WinUI.csproj b/Toolkit.UI.WinUI/Toolkit.UI.WinUI.csproj index 6c74cee..ef332bb 100644 --- a/Toolkit.UI.WinUI/Toolkit.UI.WinUI.csproj +++ b/Toolkit.UI.WinUI/Toolkit.UI.WinUI.csproj @@ -19,6 +19,7 @@ + diff --git a/Toolkit.WinUI/ContentControlHandler.cs b/Toolkit.WinUI/ContentControlHandler.cs new file mode 100644 index 0000000..12184b9 --- /dev/null +++ b/Toolkit.WinUI/ContentControlHandler.cs @@ -0,0 +1,58 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Toolkit.Foundation; + +namespace Toolkit.WinUI; + +public class ContentControlHandler : + IHandler +{ + public void Handle(NavigateTemplateEventArgs args) + { + if (args.Region is ContentControl contentControl) + { + if (args.Template is Control control) + { + TaskCompletionSource taskCompletionSource = new(); + void HandleLoaded(object? sender, RoutedEventArgs args) + { + control.Loaded -= HandleLoaded; + if (control.DataContext is object content) + { + if (content is IActivation activation) + { + activation.IsActive = true; + } + } + + taskCompletionSource.SetResult(); + } + + void HandleUnloaded(object? sender, RoutedEventArgs args) + { + control.Unloaded -= HandleLoaded; + if (control.DataContext is object content) + { + if (content is IActivation activation) + { + activation.IsActive = false; + } + + if (content is IDisposable disposable) + { + disposable.Dispose(); + } + } + } + + control.Loaded += HandleLoaded; + control.Unloaded += HandleUnloaded; + + control.DataContext = args.Content; + + contentControl.Content = null; + contentControl.Content = control; + } + } + } +} diff --git a/Toolkit.WinUI/IServiceCollectionExtensions.cs b/Toolkit.WinUI/IServiceCollectionExtensions.cs index 1e18240..245c8af 100644 --- a/Toolkit.WinUI/IServiceCollectionExtensions.cs +++ b/Toolkit.WinUI/IServiceCollectionExtensions.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.DependencyInjection; +using Microsoft.UI.Xaml.Controls; using Toolkit.Foundation; namespace Toolkit.WinUI; @@ -12,6 +13,9 @@ public static class IServiceCollectionExtensions services.AddSingleton(); services.AddTransient(); + services.AddTransient(); + + services.AddHandler(nameof(ContentControl)); services.AddTransient((Func>)(provider => new ProxyServiceCollection(services => @@ -21,4 +25,4 @@ public static class IServiceCollectionExtensions return services; } -} +} \ No newline at end of file diff --git a/Toolkit.WinUI/NavigationRegion.cs b/Toolkit.WinUI/NavigationRegion.cs new file mode 100644 index 0000000..7d4f021 --- /dev/null +++ b/Toolkit.WinUI/NavigationRegion.cs @@ -0,0 +1,28 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Toolkit.Foundation; + +namespace Toolkit.WinUI; + +public class NavigationRegion(INavigationRegionCollection collection) : + INavigationRegion +{ + public void Register(string name, + object target) + { + if (target is Control control) + { + if (!collection.ContainsKey(name)) + { + collection.Add(name, control); + void HandleUnloaded(object? sender, RoutedEventArgs args) + { + control.Unloaded -= HandleUnloaded; + collection.Remove(name); + } + + control.Unloaded += HandleUnloaded; + } + } + } +} diff --git a/Toolkit.WinUI/PageControl.cs b/Toolkit.WinUI/PageControl.cs new file mode 100644 index 0000000..a44d678 --- /dev/null +++ b/Toolkit.WinUI/PageControl.cs @@ -0,0 +1,9 @@ +using Microsoft.UI.Xaml.Controls; + +namespace Toolkit.WinUI; + +public class PageControl : + Page +{ + +} diff --git a/Toolkit.WinUI/TemplateControl.cs b/Toolkit.WinUI/TemplateControl.cs index b939f8a..a997907 100644 --- a/Toolkit.WinUI/TemplateControl.cs +++ b/Toolkit.WinUI/TemplateControl.cs @@ -23,56 +23,52 @@ public class TemplateControl : if (DataContext is IObservableViewModel observableViewModel) { - if (observableViewModel.Provider is IServiceProvider provider) + if (observableViewModel.Provider is IServiceProvider provider && + provider.GetRequiredKeyedService(DataContext.GetType().Name.Replace("ViewModel", "")) + is IContentTemplateDescriptor descriptor && + provider.GetRequiredKeyedService(descriptor.TemplateType, descriptor.Key) + is FrameworkElement control) { - if (provider.GetRequiredKeyedService(DataContext.GetType().Name.Replace("ViewModel", "")) - is IContentTemplateDescriptor descriptor) + void HandleLoaded(object? sender, RoutedEventArgs args) { - if (provider.GetRequiredKeyedService(descriptor.TemplateType, descriptor.Key) - is FrameworkElement control) + control.Loaded -= HandleLoaded; + if (control.DataContext is object content) { - void HandleLoaded(object? sender, RoutedEventArgs args) + if (content is IActivation activation) { - control.Loaded -= HandleLoaded; - if (control.DataContext is object content) - { - if (content is IActivation activation) - { - activation.IsActive = true; - } - } + activation.IsActive = true; } - - void HandleDataContextChanged(FrameworkElement? sender, DataContextChangedEventArgs args) - { - if (control.DataContext is object content) - { - if (content is IActivation activation) - { - activation.IsActive = true; - } - } - } - - void HandleUnloaded(object? sender, RoutedEventArgs args) - { - control.Unloaded -= HandleUnloaded; - if (control.DataContext is object content) - { - if (content is IActivation activation) - { - activation.IsActive = false; - } - } - } - - control.Loaded += HandleLoaded; - control.Unloaded += HandleUnloaded; - control.DataContextChanged += HandleDataContextChanged; - - Content = control; } } + + void HandleDataContextChanged(FrameworkElement? sender, DataContextChangedEventArgs args) + { + if (control.DataContext is object content) + { + if (content is IActivation activation) + { + activation.IsActive = true; + } + } + } + + void HandleUnloaded(object? sender, RoutedEventArgs args) + { + control.Unloaded -= HandleUnloaded; + if (control.DataContext is object content) + { + if (content is IActivation activation) + { + activation.IsActive = false; + } + } + } + + control.Loaded += HandleLoaded; + control.Unloaded += HandleUnloaded; + control.DataContextChanged += HandleDataContextChanged; + + Content = control; } } } diff --git a/Toolkit.WinUI/Toolkit.WinUI.csproj b/Toolkit.WinUI/Toolkit.WinUI.csproj index ea8d044..4844a14 100644 --- a/Toolkit.WinUI/Toolkit.WinUI.csproj +++ b/Toolkit.WinUI/Toolkit.WinUI.csproj @@ -20,7 +20,7 @@ - + diff --git a/Toolkit.WinUI/WinUIDispatcher.cs b/Toolkit.WinUI/WinUIDispatcher.cs index dd80281..7ae5f17 100644 --- a/Toolkit.WinUI/WinUIDispatcher.cs +++ b/Toolkit.WinUI/WinUIDispatcher.cs @@ -11,4 +11,4 @@ public class WinUIDispatcher : DispatcherQueue.GetForCurrentThread().TryEnqueue(action.Invoke); return Task.CompletedTask; } -} \ No newline at end of file +}