/// <summary> /// Displays the specified message box as a modal dialog and returns the result. /// </summary> /// <param name="mb">The message box to display.</param> /// <param name="text">The text to display.</param> /// <returns>A <see cref="ModalTask{T}"/> which returns a <see cref="MessageBoxResult"/> value that /// specifies which message box button was clicked by the user.</returns> public static ModalTask <MessageBoxResult> ShowAsync(MessageBoxModal mb, String text) { Contract.Require(mb, nameof(mb)); mb.Prepare(text, null, MessageBoxButton.OK, MessageBoxImage.None, MessageBoxResult.None); return(WrapShowDialogAsync(mb)); }
/// <summary> /// Displays the specified message box as a modal dialog. /// </summary> /// <param name="mb">The message box to display.</param> /// <param name="text">The text to display.</param> /// <param name="caption">The caption to display.</param> public static void Show(MessageBoxModal mb, String text, String caption) { Contract.Require(mb, nameof(mb)); mb.Prepare(text, caption, MessageBoxButton.OK, MessageBoxImage.None, MessageBoxResult.None); Modal.ShowDialog(mb); }
/// <summary> /// Displays the specified message box as a modal dialog. /// </summary> /// <param name="mb">The message box to display.</param> /// <param name="text">The text to display.</param> /// <param name="caption">The caption to display.</param> /// <param name="button">A <see cref="MessageBoxButton"/> value that specifies the set of buttons to display.</param> /// <param name="image">A <see cref="MessageBoxImage"/> value that specifies the image to display.</param> /// <param name="defaultResult">A <see cref="MessageBoxResult"/> value that specifies the message box's default option.</param> public static void Show(MessageBoxModal mb, String text, String caption, MessageBoxButton button, MessageBoxImage image, MessageBoxResult defaultResult) { Contract.Require(mb, nameof(mb)); mb.Prepare(text, caption, button, image, defaultResult); Modal.ShowDialog(mb); }
/// <summary> /// Displays the specified message box as a modal dialog and returns the result. /// </summary> /// <param name="mb">The message box to display.</param> /// <param name="text">The text to display.</param> /// <param name="caption">The caption to display.</param> /// <param name="button">A <see cref="MessageBoxButton"/> value that specifies the set of buttons to display.</param> /// <param name="image">A <see cref="MessageBoxImage"/> value that specifies the image to display.</param> /// <param name="defaultResult">A <see cref="MessageBoxResult"/> value that specifies the message box's default option.</param> /// <returns>A <see cref="ModalTask{T}"/> which returns a <see cref="MessageBoxResult"/> value that /// specifies which message box button was clicked by the user.</returns> public static ModalTask <MessageBoxResult> ShowAsync(MessageBoxModal mb, String text, String caption, MessageBoxButton button, MessageBoxImage image, MessageBoxResult defaultResult) { Contract.Require(mb, nameof(mb)); mb.Prepare(text, caption, button, image, defaultResult); return(WrapShowDialogAsync(mb)); }