private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBox comboBox = sender as ComboBox; if (comboBox.SelectedIndex != -1) { switch (comboBox.SelectedIndex) { case 0: Ex1 ex1 = new Ex1(); ex1.ShowDialog(); break; case 1: Ex2 ex2 = new Ex2(); ex2.ShowDialog(); break; case 2: Ex3 ex3 = new Ex3(); ex3.ShowDialog(); break; } } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.mainWindow = ((WpfLaba.Ex2)(target)); return; case 2: this.gbExternal = ((System.Windows.Controls.GroupBox)(target)); return; case 3: this.gbInternal1 = ((System.Windows.Controls.GroupBox)(target)); return; case 4: this.gbInternal2 = ((System.Windows.Controls.GroupBox)(target)); return; } this._contentLoaded = true; }