Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }