private async void SavePreset() { using (LayoutService.Working("Saving...")) { await PresetManager.AddPresetAsync(Preset); JobManager.InitialiseJobs(Preset, ApplicationService.AppStoppingCancellationToken); if (OnAdd.HasDelegate) { await OnAdd.InvokeAsync(); } LayoutService.RaiseChange(); await InvokeAsync(StateHasChanged); } }
private async void DeletePreset() { using (LayoutService.Working("Deleting...")) { bool?result = await DialogService.ShowMessageBox( "Warning", "Deleting can not be undone!", yesText : "Delete!", cancelText : "Cancel"); if (result ?? false) { await PresetManager.DeletePresetAsync(Preset); LayoutService.RaiseChange(); } await InvokeAsync(StateHasChanged); } }