Пример #1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.GameWindow = ((WpfApp2.SingleGameWindow)(target));

            #line 10 "..\..\SingleGameWindow.xaml"
                this.GameWindow.SizeChanged += new System.Windows.SizeChangedEventHandler(this.Window_SizeChanged);

            #line default
            #line hidden

            #line 11 "..\..\SingleGameWindow.xaml"
                this.GameWindow.LocationChanged += new System.EventHandler(this.Window_LocationChanged);

            #line default
            #line hidden

            #line 12 "..\..\SingleGameWindow.xaml"
                this.GameWindow.Activated += new System.EventHandler(this.Window_Activated);

            #line default
            #line hidden

            #line 13 "..\..\SingleGameWindow.xaml"
                this.GameWindow.Closed += new System.EventHandler(this.Window_Closed);

            #line default
            #line hidden
                return;

            case 2:
                this.gameGrid = ((System.Windows.Controls.Grid)(target));

            #line 17 "..\..\SingleGameWindow.xaml"
                this.gameGrid.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.GameGrid_MouseDown);

            #line default
            #line hidden
                return;

            case 3:
                this.GameCanvas = ((System.Windows.Controls.Canvas)(target));

            #line 23 "..\..\SingleGameWindow.xaml"
                this.GameCanvas.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.GameGrid_MouseDown);

            #line default
            #line hidden
                return;

            case 4:
                this.lbUserScore = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #2
0
        private void btnStartgame_Click(object sender, RoutedEventArgs e)
        {
            string sizestr     = tbMatrixsize.Text;
            int    size        = 0;
            bool   isconverted = Int32.TryParse(sizestr, out size);

            if (isconverted)
            {
                lbErrorMsg.Content = String.Empty;
                Window wind = new SingleGameWindow(this, size);
                Hide();
                wind.ShowDialog();
            }
            else
            {
                lbErrorMsg.Content = "Inputted text is not a number";
            }
        }