private void EditConfiguration_Click(object sender, RoutedEventArgs e) { // Manually create window Window wnd = new Window(); wnd.WindowStartupLocation = WindowStartupLocation.CenterOwner; wnd.Owner = Application.Current.MainWindow; wnd.Title = Properties.Resources.PrintingQueuesConfigurationWindowTitle; wnd.Width = 600; wnd.Height = 400; wnd.Icon = BitmapFrame.Create(this.GetPackUri("Images/TypeEditors/PrintHS.png")); wnd.Closing += (a, b) => { var result = MessageBox.Show(Properties.Resources.PrintingQueuesConfigurationWindowLeaveConfirmation_MSG, Properties.Resources.PrintingQueuesConfigurationWindowLeaveConfirmation_CAP, MessageBoxButton.YesNoCancel, MessageBoxImage.Question); if (result == MessageBoxResult.Cancel) { b.Cancel = true; return; } wnd.DialogResult = (result == MessageBoxResult.Yes) ? true : false; }; PrintingQueuesEditor editorctrl = new PrintingQueuesEditor(); editorctrl.ValueWrapper = _valueRaw; wnd.Content = editorctrl; if (wnd.ShowDialog() == true) { _valueRaw = editorctrl.ValueWrapper; } }
private void EditConfiguration_Click(object sender, RoutedEventArgs e) { // Manually create window Window wnd = new Window(); wnd.WindowStartupLocation = WindowStartupLocation.CenterOwner; wnd.Owner = Application.Current.MainWindow; wnd.Title = Properties.Resources.PrintingQueuesConfigurationWindowTitle; wnd.Width = 600; wnd.Height = 400; wnd.Icon = BitmapFrame.Create(this.GetPackUri("Images/TypeEditors/PrintHS.png")); wnd.Closing += (a, b) => { var result = MessageBox.Show(Properties.Resources.PrintingQueuesConfigurationWindowLeaveConfirmation_MSG, Properties.Resources.PrintingQueuesConfigurationWindowLeaveConfirmation_CAP, MessageBoxButton.YesNoCancel, MessageBoxImage.Question); if (result == MessageBoxResult.Cancel) { b.Cancel = true; return; } wnd.DialogResult = (result == MessageBoxResult.Yes) ? true : false; }; PrintingQueuesEditor editorctrl = new PrintingQueuesEditor(); editorctrl.ValueWrapper = _valueRaw; wnd.Content = editorctrl; if (wnd.ShowDialog() == true) { _valueRaw = editorctrl.ValueWrapper; } }