public void ShowWarning(string caption, string message, MessageBoxHelpButton helpButton = null) { this.ShowMessageBox(caption, message, MessageBoxIconType.Warning, helpButton, new MessageBoxButton(OkButtonText, null, true, true)); }
public TResult ShowMessageBox <TResult>(string caption, string message, MessageBoxIconType icon, MessageBoxHelpButton helpButton, params MessageBoxButton <TResult>[] buttons) { return((TResult)this.ShowMessageBox(caption, message, icon, helpButton, buttons.Cast <MessageBoxButton>().ToArray())); }
public bool AskUserOkCancel(string caption, string message, MessageBoxIconType icon = MessageBoxIconType.Question, MessageBoxHelpButton helpButton = null) { return(this.ShowMessageBox(caption, message, icon, helpButton, new MessageBoxButton <bool>(OkButtonText, true, true), new MessageBoxButton <bool>(CancelButtonText, false, false, true))); }
public object ShowMessageBox(string caption, string message, MessageBoxIconType icon, MessageBoxHelpButton helpButton, params MessageBoxButton[] buttons) { object result = null; Execute.OnUIThread(() => { var viewModel = new MessageBoxViewModel { DisplayName = caption, Message = message, Icon = icon }; if (buttons != null) { foreach (var messageBoxButton in buttons) { viewModel.AddButton(messageBoxButton); } } if (helpButton != null) { viewModel.HelpButtonCallback = helpButton.Action; viewModel.HelpButtonText = helpButton.Text; } _windowManager.ShowDialog(viewModel); result = viewModel.DialogResult; }); return(result); }