private void NextButton_Click(object sender, RoutedEventArgs e) { string selected = comboBox.SelectedItem.ToString(); int index = lst.FindIndex(a => a == selected); switch (index) { case 0: Report1Window.GetInstance().Show(); this.Close(); break; case 1: Report2Window.GetInstance().Show(); this.Close(); break; case 2: Report3Window.GetInstance().Show(); this.Close(); break; case 3: Report4Window.GetInstance().Show(); this.Close(); break; case 4: Report5Window.GetInstance().Show(); this.Close(); break; } }
public static Report4Window GetInstance() { if (instance == null) { instance = new Report4Window(); } return(instance); }
private void Window_Unloaded(object sender, RoutedEventArgs e) { instance = null; }