diff --git a/BetterGenshinImpact/App.xaml b/BetterGenshinImpact/App.xaml index 051f55de..96835942 100644 --- a/BetterGenshinImpact/App.xaml +++ b/BetterGenshinImpact/App.xaml @@ -1,9 +1,7 @@  + xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"> diff --git a/BetterGenshinImpact/App.xaml.cs b/BetterGenshinImpact/App.xaml.cs index 73a420ed..2d562ca9 100644 --- a/BetterGenshinImpact/App.xaml.cs +++ b/BetterGenshinImpact/App.xaml.cs @@ -112,16 +112,14 @@ public partial class App : Application /// /// Occurs when the application is loading. /// - private void OnStartup(object sender, StartupEventArgs e) + protected override async void OnStartup(StartupEventArgs e) { - StartUp(); - } + base.OnStartup(e); - private async void StartUp() - { try { - await StartUpCoreAsync(); + RegisterEvents(); + await _host.StartAsync(); await UrlProtocolHelper.RegisterAsync(); } catch (Exception ex) @@ -136,19 +134,14 @@ public partial class App : Application } } - private async Task StartUpCoreAsync() - { - RegisterEvents(); - await _host.StartAsync(); - } - /// /// Occurs when the application is closing. /// - private async void OnExit(object sender, ExitEventArgs e) + protected override async void OnExit(ExitEventArgs e) { - await _host.StopAsync(); + base.OnExit(e); + await _host.StopAsync(); _host.Dispose(); }