private void SimpleDialogButton_Click(object sender, RoutedEventArgs e) { SimpleDialog dialog = CreateSimpleDialog(); try { dialog.ShowSimpleDialog(); //MessageBox.Show(dialog.ShowSimpleDialog().ToString()); } catch { //dialog.ShowSimpleDialog() returned null } }