public void uxFileNewHaiku_Click(object sender, RoutedEventArgs e) { var haikuWindow = new HaikuWindow(); Application.Current.MainWindow = haikuWindow; haikuWindow.Show(); this.Close(); }
public void uxButtonGenerateHaiku_Click(object sender, RoutedEventArgs e) { string returnRecent = GenerateRandom.RandomHaiku; HaikuWindow haikuWindow = new HaikuWindow(); MainWindow mainWindow = new MainWindow(); Lorry.Repository.Recents.Recent newRecent = new Repository.Recents.Recent(); newRecent.RecentContent = returnRecent; newRecent.RecentDate = DateTime.Now.ToString("MM.dd.yyyy"); newRecent.RecentType = "haiku"; Lorry.Repository.IDatabaseRepository <Repository.Recents.Recent> addRecent = new Lorry.Repository.Recents.RecentRepository(); addRecent.Insert(newRecent); Application.Current.MainWindow = haikuWindow; mainWindow.uxExpanderRecent.IsExpanded = true; }