private void HealthButton_Click(object sender, RoutedEventArgs e) { if (money >= 10) { money -= 10; labelMoney.Content = money + "$"; this.Visibility = System.Windows.Visibility.Hidden; Conquest.MainWindow m = new Conquest.MainWindow(); m.Closed += healthClosed; m.Show(); } else { MessageBox.Show("Not enough gold! You need 10!"); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.window1 = ((Conquest.MainWindow)(target)); #line 4 "..\..\..\MainWindow.xaml" this.window1.KeyDown += new System.Windows.Input.KeyEventHandler(this.window1_KeyDown); #line default #line hidden return; case 2: this.wrapPanel1 = ((System.Windows.Controls.WrapPanel)(target)); return; case 3: this.wrapPanel2 = ((System.Windows.Controls.WrapPanel)(target)); return; case 4: this.button1 = ((System.Windows.Controls.Button)(target)); #line 7 "..\..\..\MainWindow.xaml" this.button1.Click += new System.Windows.RoutedEventHandler(this.button1_Click); #line default #line hidden return; case 5: this.button2 = ((System.Windows.Controls.Button)(target)); #line 8 "..\..\..\MainWindow.xaml" this.button2.Click += new System.Windows.RoutedEventHandler(this.button2_Click); #line default #line hidden return; case 6: this.button3 = ((System.Windows.Controls.Button)(target)); #line 9 "..\..\..\MainWindow.xaml" this.button3.Click += new System.Windows.RoutedEventHandler(this.button3_Click); #line default #line hidden return; case 7: this.button4 = ((System.Windows.Controls.Button)(target)); #line 10 "..\..\..\MainWindow.xaml" this.button4.Click += new System.Windows.RoutedEventHandler(this.button4_Click); #line default #line hidden return; case 8: this.button5 = ((System.Windows.Controls.Button)(target)); #line 11 "..\..\..\MainWindow.xaml" this.button5.Click += new System.Windows.RoutedEventHandler(this.button5_Click); #line default #line hidden return; } this._contentLoaded = true; }