Improved event naming
This commit is contained in:
@@ -89,7 +89,7 @@ public partial class App : Application
|
||||
|
||||
services.AddTemplate<ItemHeaderViewModel, ItemHeaderView>();
|
||||
|
||||
services.AddHandler<ItemConfigurationHandler>();
|
||||
services.AddHandler<CreateItemHandler>();
|
||||
});
|
||||
})!);
|
||||
|
||||
|
||||
@@ -7,15 +7,15 @@ using Toolkit.Foundation;
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public class AppHandler(IPublisher publisher) :
|
||||
INotificationHandler<Started>
|
||||
INotificationHandler<StartedEventArgs>
|
||||
{
|
||||
public async Task Handle(Started args, CancellationToken cancellationToken = default)
|
||||
public async Task Handle(StartedEventArgs args, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (Application.Current is Application application)
|
||||
{
|
||||
if (application.ApplicationLifetime is IApplicationLifetime lifetime)
|
||||
{
|
||||
await publisher.Publish(new Navigate(lifetime is IClassicDesktopStyleApplicationLifetime ? "MainWindow" : "Main",
|
||||
await publisher.Publish(new NavigateEventArgs(lifetime is IClassicDesktopStyleApplicationLifetime ? "MainWindow" : "Main",
|
||||
lifetime is IClassicDesktopStyleApplicationLifetime ? typeof(IClassicDesktopStyleApplicationLifetime) :
|
||||
typeof(ISingleViewApplicationLifetime)), cancellationToken);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user