public static CommandResult OpenOptionDialog(ICommandTarget target) { IPoderosaMainWindow window = CommandTargetUtil.AsWindow(target); OptionDialog dlg = new OptionDialog(); if (dlg.ShowDialog(window.AsForm()) == DialogResult.OK) { return(CommandResult.Succeeded); } else { return(CommandResult.Cancelled); } }
private void OpenOptionDialog() { OptionDialog dialog = new OptionDialog { Owner = Application.Current.MainWindow, DataContext = OptionsViewModel }; bool?dialogResult = dialog.ShowDialog(); if (dialogResult.HasValue && dialogResult.Value) { OptionsViewModel.Save(CurrentProfile.Header); } else { OptionsViewModel.CancelDialog(CurrentProfile.Header); } }
private void optionsToolStripMenuItem_Click(object sender, EventArgs e) { OptionDialog options = new OptionDialog(); options.ShowDialog(); }