public static bool ShowDialog(NewWindow newWindow, string sTitle, string sBtnFirst, string sBtnSecond, string sLabel) { MyOwnDialog dialog = new MyOwnDialog(); dialog.Owner = newWindow; dialog.Title = sTitle; dialog.btnFirst.Content = sBtnFirst; dialog.btnSecond.Content = sBtnSecond; dialog.mainLabel.Text = sLabel; if (dialog.ShowDialog() == true) { return(true); } return(false); }
private void MenuItem_Click(object sender, RoutedEventArgs e) { NewWindow newWindow = new NewWindow(); newWindow.Owner = this; if (newWindow.ShowDialog() == true) { bIsActiveDocument = true; passwordToEncode = newWindow.tbPassword.Password; TurnOnVisibility(); ClearAll(); EnableControls(); appManagement.appVariables.sActualFilePath = newWindow.sInputDir; } else { bIsActiveDocument = false; appManagement.RemoveEmptyFile(); } }