public async Task <SixMessageBoxResult> MessageBox(MessageBoxDialogParams dialogParams) { var r = await _api.ShowMessageBox(dialogParams.Title, dialogParams.Message, GetButtons(dialogParams)) .ConfigureAwait(false); return((SixMessageBoxResult)Enum.Parse(typeof(SixMessageBoxResult), r)); }
public async Task <SixMessageBoxResult> MessageBox(MessageBoxDialogParams dialogParams) { var ev = GetMessageBoxViewModel(dialogParams); await ShowDialog(ev); var vm = ev; return(vm.Result); }
// TODO: Consider using messageboxes directly like any other View with actions? protected async Task <SixMessageBoxResult> MetroMessageBox(MessageBoxDialogParams dialogParams) { ConfirmAccess(); var ev = GetMetroMessageBoxViewModel(dialogParams); await ShowMetroDialog(ev); var vm = ev; return(vm.Result); }
static MetroMessageBoxViewModel GetMetroMessageBoxViewModel(MessageBoxDialogParams dialogParams) { MetroMessageBoxViewModel ev; if (dialogParams.IgnoreContent) { ev = new MetroMessageBoxViewModel(dialogParams.Message, dialogParams.Title, GetButton(dialogParams.Buttons), dialogParams.RememberedState); } else { ev = new MetroMessageBoxViewModel(dialogParams.Message, dialogParams.Title, GetButton(dialogParams.Buttons), dialogParams.RememberedState) { GreenButtonContent = dialogParams.GreenContent, BlueButtonContent = dialogParams.BlueContent, RedButtonContent = dialogParams.RedContent }; } return(ev); }
private static string[] GetButtons(MessageBoxDialogParams dialogParams) { switch (dialogParams.Buttons) { case SixMessageBoxButton.OK: { return(new[] { "OK" }); } case SixMessageBoxButton.OKCancel: { return(new[] { "OK", "Cancel" }); } case SixMessageBoxButton.YesNo: { return(new[] { "Yes", "No" }); } case SixMessageBoxButton.YesNoCancel: { return(new[] { "Yes", "No", "Cancel" }); } } throw new NotSupportedException("Unsupported messagebox option"); }
public Task <SixMessageBoxResult> MessageBox(MessageBoxDialogParams dialogParams) { throw new NotImplementedException(); }
public Task <SixMessageBoxResult> MessageBox(MessageBoxDialogParams dialogParams) => _wm.MessageBox(dialogParams);