void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.LevelFive = ((GameLabNumber2.Level5)(target)); return; case 2: this.gMain = ((System.Windows.Controls.Grid)(target)); return; case 3: this.dMain = ((System.Windows.Controls.DockPanel)(target)); return; case 4: this.firstlView = ((System.Windows.Controls.ListView)(target)); return; case 5: this.FirstTask = ((System.Windows.Controls.ListBoxItem)(target)); return; case 6: this.SecondTask = ((System.Windows.Controls.ListBoxItem)(target)); return; case 7: this.secondlView = ((System.Windows.Controls.ListView)(target)); return; case 8: this.FirstQuest = ((System.Windows.Controls.ListBoxItem)(target)); return; case 9: this.SecondQuest = ((System.Windows.Controls.ListBoxItem)(target)); return; case 10: this.logLabel = ((System.Windows.Controls.Label)(target)); return; case 11: this.tbAnswer = ((System.Windows.Controls.TextBox)(target)); return; case 12: this.answerButton = ((System.Windows.Controls.Button)(target)); return; } this._contentLoaded = true; }
private void buttonAnswer_Click(object sender, RoutedEventArgs e) { if ((bool)rbOne.IsChecked) { foreach (var obj in dPanel.Children) { CheckBox chBox = (CheckBox)obj; if ((bool)chBox.IsChecked) { listCheckBox.Add(Convert.ToInt32(chBox.Content)); } } } if ((bool)rbTwo.IsChecked) { foreach (var obj in dPanel.Children) { CheckBox chBox = (CheckBox)obj; if ((bool)chBox.IsChecked) { listCheckBox.Add(Convert.ToInt32(chBox.Content)); } } } string str = ""; if (listCheckBox.Count == 8) // 01371349 { foreach (var item in listCheckBox) { str += item; } } if (str.Equals(answerTrue)) { Level5 lvl5 = new Level5(); lvl5.Show(); Level4.Close(); } }