private void InitializeDialogProviders() { CrudDialogProvider.AddDialog <PresetViewModel>(_serviceProvider.GetService <INestedViewDialog <PresetViewModel> >()); CrudDialogProvider.AddDialog <RegionViewModel>(_serviceProvider.GetService <INestedViewDialog <RegionViewModel> >()); var messageBox = new MessageBoxProvider(_serviceProvider.GetService <IDialogService <MessageBoxDialog, LulDialogResult> >()); var inputProvider = new InputDialogProvider(_serviceProvider.GetService <IDialogService <InputDialog, InputDialogResult> >()); }
public static void InitializeInputDialog(string inputResult, DialogResults buttonResults) { InputDialogResult result = new InputDialogResult() { Input = inputResult, DialogResult = buttonResults }; var dialogService = Substitute.For <IDialogService <InputDialog, InputDialogResult> >(); dialogService.Show(Arg.Any <string>(), Arg.Any <string>(), DialogButtons.OkCancel).Returns(result); var dialog = new InputDialogProvider(dialogService); }
public void AddTriggerClicked(object args) { if (InputDialogProvider.Show("New Trigger", "New Trigger Name:", DialogButtons.OkCancel) is InputDialogResult dialogResult && dialogResult.DialogResult == DialogResults.Ok) { if (string.IsNullOrWhiteSpace(dialogResult.Input)) { return; } var newTrigger = _triggerController.CreateTrigger(SelectedPreset.Id, SelectedRegion.Id, dialogResult.Input); SelectedRegion.Triggers.Add(newTrigger); SelectedTrigger = newTrigger; } }