private void RenameNote(object sender, RoutedEventArgs e) { var popup = new FormWindow { WindowStartupLocation = WindowStartupLocation.CenterOwner, Owner = this }; popup.ShowDialog(); string title = popup.TextForm; if (popup.Successful && title != "Default") { File.Move(this.currentFilePath, this.mainPath + "\\" + title + ".txt"); } }
private void CreateText(object sender, RoutedEventArgs e) { var popup = new FormWindow { WindowStartupLocation = WindowStartupLocation.CenterOwner, Owner = this }; popup.ShowDialog(); string title = popup.TextForm; if (popup.Successful && title != "Default") { string path = this.mainPath + "\\" + title + ".txt"; File.WriteAllText(path, ""); this.OpenNotepad(path); } }