Click or drag to resize

IWPFMessageBoxWrapper Interface

Show a WPF window as a message box which is full configurable.

Namespace:  SniffCore.MessageBoxes
Assembly:  SniffCore.MessageBoxes (in SniffCore.MessageBoxes.dll) Version: 1.0.0
Syntax
C#
public interface IWPFMessageBoxWrapper
Methods
  NameDescription
Public methodShow(String)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(String, WPFMessageBoxOptions)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(String, String)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(Window, String)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(String, String, WPFMessageBoxButtons)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(String, String, WPFMessageBoxOptions)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(Window, String, WPFMessageBoxOptions)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(Window, String, String)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(String, String, WPFMessageBoxButtons, WPFMessageBoxImages)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(String, String, WPFMessageBoxButtons, WPFMessageBoxOptions)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(Window, String, String, WPFMessageBoxButtons)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(Window, String, String, WPFMessageBoxOptions)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(String, String, WPFMessageBoxButtons, WPFMessageBoxImages, WPFMessageBoxOptions)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(String, String, WPFMessageBoxButtons, WPFMessageBoxImages, WPFMessageBoxResult)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(Window, String, String, WPFMessageBoxButtons, WPFMessageBoxImages)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(Window, String, String, WPFMessageBoxButtons, WPFMessageBoxOptions)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(String, String, WPFMessageBoxButtons, WPFMessageBoxImages, WPFMessageBoxResult, WPFMessageBoxOptions)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(Window, String, String, WPFMessageBoxButtons, WPFMessageBoxImages, WPFMessageBoxOptions)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(Window, String, String, WPFMessageBoxButtons, WPFMessageBoxImages, WPFMessageBoxResult)
Displays a message box that has a message and that returns a result of the button the user pressed.
Public methodShow(Window, String, String, WPFMessageBoxButtons, WPFMessageBoxImages, WPFMessageBoxResult, WPFMessageBoxOptions)
Displays a message box that has a message and that returns a result of the button the user pressed.
Top
Examples
C#
public class ViewModel : ObservableObject
{
    private IWPFMessageBoxWrapper _messageBox
    public ViewModel(IWPFMessageBoxWrapper messageBox)
    {
        _messageBox = messageBox;
    }

    public void Show()
    {
        messageBox.Show("Messagebox Text");
    }
}

[TestFixture]
public class ViewModelTests
{
    private Mock<IWPFMessageBoxWrapper> _messageBox;
    private ViewModel _target;

    [SetUp]
    public void Setup()
    {
        _messageBox = new Mock<IWPFMessageBoxWrapper>();
        _target = new ViewModel(_messageBox.Object);
    }

    [Test]
    public void Show_Called_ShowsMessageBox()
    {
        _target.Show();

        _messageBox.Verify(x => x.Show("Messagebox Text"), Times.Once);
    }
}
See Also