DialogResult in WPF Application in C#

Here is how you do the same in WPF:

MessageBoxResult result = MessageBox.Show("My Message Question", "My Title", MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result == MessageBoxResult.Yes)
{
    // Do this
}

Use MessageBoxResult instead. And use the MessageBox class. But this message box will look pretty ugly "classic" style.

Another option would be to use Extended WPF toolkit

Yet another option would be to go here and download CrossTechnologySamples.exe then look into the VistaBridge project. I recommend you give a good look here because you will find other samples for other dialogs (like FileOpen, FileSave etc.) that do not exist by default in WPF.

Tags:

C#

Wpf