private void HistoryBtn_Click(object sender, RoutedEventArgs e) { var history = new HistoryNyse(); history.Show(); this.Close(); }
//keyboard button handler ::: private void HandleKey(object sender, KeyEventArgs e) { if (e.Key == Key.H) { var history = new HistoryNyse(); history.Show(); this.Close(); } if (e.Key == Key.I) { //Prevent multiple import windows to be opened foreach (Window w in Application.Current.Windows) { if (w is Import) { isWindowOpen = true; w.Activate(); } } //If import window is not open if (!isWindowOpen) { Import newwindow = new Import(); newwindow.Show(); } } }