public partial class Window1 : Window { public List<string> memberData = new List<string>(); public Window1() { InitializeComponent(); } private void Button_Click(object sender, RoutedEventArgs e) { memberData.Add(textBox1.Text); memberData.Add(textBox2.Text); memberData.Add(textBox3.Text); memberData.Add((combo1.SelectedItem ?? "").ToString()); Window2 form = new Window2(); form.Show(); firstWindow.Close(); } } ......
public partial class Window2 : Window { void choosing(string some) { switch (some) { case ("abc"): { break; } case ("bcd"): { break; } } } public Window2() { InitializeComponent(); //firstCombo.Items.Add(str); choosing(<элемент коллекции memberData>); } private void Button_Click(object sender, RoutedEventArgs e) { Window3 form = new Window3(); form.Show(); secondWindow.Close(); } } Tell memberData how to pass the 3rd element of the memberData collection from the class of the first window to the class of the second window as an argument to the choosing function?