private void Button_Click(object sender, RoutedEventArgs e) { var res = ModalDialog.ShowHandlerDialog("Test"); //var resultMessagePrefix = "Result: "; if (res) { MessageBox.Show("we"); } else { MessageBox.Show("sh"); } }