C # WPF message box in the wording

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 ();
  }

}

Guess you like

Origin www.cnblogs.com/YYMMDD/p/12210774.html
Recommended