Improve the code for Desktop Exit

This commit is contained in:
2dust
2024-11-08 11:11:06 +08:00
parent d12297909c
commit 47318b5d70
2 changed files with 12 additions and 26 deletions

View File

@@ -52,8 +52,6 @@ namespace ServiceLib.ViewModels
public ReactiveCommand<Unit, Unit> ReloadCmd { get; }
public ReactiveCommand<Unit, Unit> ExitCmd { get; }
[Reactive]
public bool BlReloadEnabled { get; set; }
@@ -189,11 +187,6 @@ namespace ServiceLib.ViewModels
await Reload();
});
ExitCmd = ReactiveCommand.CreateFromTask(async () =>
{
await Exit();
});
RegionalPresetDefaultCmd = ReactiveCommand.CreateFromTask(async () =>
{
await ApplyRegionalPreset(EPresetType.Default);
@@ -595,16 +588,6 @@ namespace ServiceLib.ViewModels
}
}
private async Task Exit()
{
if (await _updateView?.Invoke(EViewAction.ShowYesNo, null) == false)
{
return;
}
await MyAppExitAsync(false);
}
#endregion core job
#region Presets