private void button_Click(object sender, RoutedEventArgs e)
        {
            if (Convert.ToString(((Button)sender).Content) == "New Game")
            {
                GameWnd gamewnd = new GameWnd();

                this.Close();
                gamewnd.ShowDialog();

                /*CanvasBackground.Children.Clear();
                 * gw.SetGameBackground(CanvasBackground);
                 * move = new Movement(gw.Ceiling, gw.Floor);
                 */
            }
            if (Convert.ToString(((Button)sender).Content) == "Exit")
            {
                this.Close();
            }
            run = true;
        }
Beispiel #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.gwnd = ((Jumper.GameWnd)(target));

            #line 8 "..\..\GameWnd.xaml"
                this.gwnd.KeyDown += new System.Windows.Input.KeyEventHandler(this.gwnd_KeyDown);

            #line default
            #line hidden
                return;

            case 2:
                this.BackgroundCanvas = ((System.Windows.Controls.Canvas)(target));
                return;

            case 3:
                this.top = ((System.Windows.Controls.Image)(target));
                return;

            case 4:
                this.bottom = ((System.Windows.Controls.Image)(target));
                return;

            case 5:
                this.player = ((System.Windows.Controls.Image)(target));
                return;

            case 6:
                this.Obstacle_image = ((System.Windows.Controls.Image)(target));
                return;

            case 7:
                this.Obstacle_top_image = ((System.Windows.Controls.Image)(target));
                return;

            case 8:
                this.sky = ((System.Windows.Controls.Image)(target));
                return;

            case 9:
                this.cloud1 = ((System.Windows.Controls.Image)(target));
                return;

            case 10:
                this.cloud2 = ((System.Windows.Controls.Image)(target));
                return;

            case 11:
                this.cloud3 = ((System.Windows.Controls.Image)(target));
                return;

            case 12:
                this.textBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 13:
                this.Obstacle_2_image = ((System.Windows.Controls.Image)(target));
                return;

            case 14:
                this.Obstacle_top_2_image = ((System.Windows.Controls.Image)(target));
                return;
            }
            this._contentLoaded = true;
        }