https://github.com/2dust/v2rayN/issues/5963
This commit is contained in:
2dust
2024-11-08 19:24:36 +08:00
parent 47318b5d70
commit 4c49e52e26
4 changed files with 22 additions and 11 deletions

View File

@@ -69,11 +69,12 @@ public partial class App : Application
}
}
private void MenuExit_Click(object? sender, EventArgs e)
private async void MenuExit_Click(object? sender, EventArgs e)
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
Locator.Current.GetService<MainWindowViewModel>()?.MyAppExitAsync(false);
var service = Locator.Current.GetService<MainWindowViewModel>();
if (service != null) await service.MyAppExitAsync(false);
desktop.Shutdown();
}