In winform in the message box we generally write
void Button_Click Private (Object SENDER, RoutedEventArgs E)
{
IF (MessageBox.Show ( "To exit the program do?", "Exit the program", MessageBoxButton.YesNo) == DialogResult.Yes )
{
this.Close ();
}
}
DialogResult in WPF where no Yes or No value of the enumeration, so it should be written
void Button_Click Private (Object SENDER, RoutedEventArgs E)
{
IF (MessageBox.Show ( "To exit the program do?", "Exit the program", MessageBoxButton.YesNo) == MessageBoxResult.Yes )
{
this.Close ();
}
}