private void button_Click(object sender, RoutedEventArgs e) { SaveFileDialog menuSaveAs = new SaveFileDialog(); menuSaveAs.Filter = "Text file (*.txt)|*.txt"; if (menuSaveAs.ShowDialog() == true) { File.WriteAllText(menuSaveAs.FileName, ""); } SaveNewFilePrompt.Close(); MainWindow newWindow = new MainWindow(); newWindow.Show(); newWindow.fileName = menuSaveAs.FileName; newWindow.OpenFile(newWindow.fileName); newWindow.hasFileName = true; newWindow.textBlock.Text = newWindow.fileName; }
private void MenuNew_Click(object sender, RoutedEventArgs e) { MainWindow newWindow = new MainWindow(); newWindow.Show(); }
private void button1_Click(object sender, RoutedEventArgs e) { SaveNewFilePrompt.Close(); MainWindow menuNew = new MainWindow(); menuNew.Show(); }