WPFMessageBox ClassDW.WPFToolkit Documentation
Show a WPF window as a messagebox which is full configurable.
WPFMessageBox
Inheritance Hierarchy

SystemObject
  System.Windows.ThreadingDispatcherObject
    System.WindowsDependencyObject
      System.Windows.MediaVisual
        System.WindowsUIElement
          System.WindowsFrameworkElement
            System.Windows.ControlsControl
              System.Windows.ControlsContentControl
                System.WindowsWindow
                  DW.WPFToolkit.ControlsWPFMessageBox

Namespace: DW.WPFToolkit.Controls
Assembly: DW.WPFToolkit (in DW.WPFToolkit.dll) Version: 5.6.0.0
Syntax

C#
public class WPFMessageBox : Window, 
	INotifyPropertyChanged, IComponentConnector

The WPFMessageBox type exposes the following members.

Methods

  NameDescription
Public methodInitializeComponent
InitializeComponent
Protected methodOnClosing
Raises the System.Windows.Window.Closing event.
(Overrides WindowOnClosing(CancelEventArgs).)
Protected methodOnContentRendered
Raises the System.Windows.Window.ContentRendered event.
(Overrides WindowOnContentRendered(EventArgs).)
Protected methodOnPreviewKeyDown
Invoked when an unhandled System.Windows.Input.Keyboard.PreviewKeyDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
(Overrides UIElementOnPreviewKeyDown(KeyEventArgs).)
Protected methodOnSourceInitialized
Raises the System.Windows.Window.SourceInitialized event.
(Overrides WindowOnSourceInitialized(EventArgs).)
Public methodStatic memberShow(String)
Displays a message box that has a message and that returns a result.
Public methodStatic memberShow(String, String)
Displays a message box that has a message and that returns a result.
Public methodStatic memberShow(Window, String)
Displays a message box that has a message and that returns a result.
Public methodStatic memberShow(String, String, WPFMessageBoxButtons)
Displays a message box that has a message and that returns a result.
Public methodStatic memberShow(Window, String, String)
Displays a message box that has a message and that returns a result.
Public methodStatic memberShow(String, String, WPFMessageBoxButtons, WPFMessageBoxImage)
Displays a message box that has a message and that returns a result.
Public methodStatic memberShow(Window, String, String, WPFMessageBoxButtons)
Displays a message box that has a message and that returns a result.
Public methodStatic memberShow(String, String, WPFMessageBoxButtons, WPFMessageBoxImage, WPFMessageBoxResult)
Displays a message box that has a message and that returns a result.
Public methodStatic memberShow(Window, String, String, WPFMessageBoxButtons, WPFMessageBoxImage)
Displays a message box that has a message and that returns a result.
Public methodStatic memberShow(String, String, WPFMessageBoxButtons, WPFMessageBoxImage, WPFMessageBoxResult, WPFMessageBoxOptions)
Displays a message box that has a message and that returns a result.
Public methodStatic memberShow(Window, String, String, WPFMessageBoxButtons, WPFMessageBoxImage, WPFMessageBoxResult)
Displays a message box that has a message and that returns a result.
Public methodStatic memberShow(Window, String, String, WPFMessageBoxButtons, WPFMessageBoxImage, WPFMessageBoxResult, WPFMessageBoxOptions)
Displays a message box that has a message and that returns a result.
Top
Properties

  NameDescription
Public propertyButtons
Gets or sets which buttons has to be shown.
Public propertyDefaultButton
Gets or sets which button is the default button after showing the WPFMessageBox.
Public propertyImage
Gets or sets the icon to show.
Public propertyIsDetailsExpanded
Gets or sets a value which indicates of the details are shown or not
Public propertyMessage
Gets or sets the message to be show.
Public propertyOptions
Gets or sets the additional WPFMessageBox options.
Public propertyResult
Gets or sets the result how the user closed the WPFMessageBox.
Top
Events

  NameDescription
Public eventPropertyChanged
Occurs when a property value changes.
Top
Examples

C#
public void Show1()
{
    WPFMessageBox.Show("Messagebox Text");
}

public void Show2()
{
    WPFMessageBox.Show("Messagebox Text", "Caption");
}

public void Show3()
{
    WPFMessageBox.Show("Messagebox Text", "Caption", WPFMessageBoxButtons.AbortRetryIgnore);
}

public void Show4()
{
    var options = new WPFMessageBoxOptions();
    options.DetailsContent = new Label();
    options.ShowDetails = true;
    options.ShowHelpButton = true;
    options.Strings.Abort = "Go Away";
    options.WindowOptions.DetailedResizeMode = ResizeMode.CanResizeWithGrip;

    WPFMessageBox.Show("Messagebox Text",
                       "Caption",
                       WPFMessageBoxButtons.AbortRetryIgnore,
                       WPFMessageBoxImage.Error,
                       WPFMessageBoxResult.Retry, options);
}
See Also

Reference