예제 #1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.myBoard = ((Battleships.SeaBoard)(target));
                return;

            case 2:
                this.enemyBoard = ((Battleships.SeaBoard)(target));
                return;

            case 3:
                this.labelMyNickname = ((System.Windows.Controls.Label)(target));
                return;

            case 4:
                this.labelEnemyNickname = ((System.Windows.Controls.Label)(target));
                return;

            case 5:
                this.buttonGameResult = ((System.Windows.Controls.Button)(target));

            #line 28 "..\..\GameView.xaml"
                this.buttonGameResult.Click += new System.Windows.RoutedEventHandler(this.buttonGameResult_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
예제 #2
0
            public SeaBoardCell(SeaBoard owner, int x, int y)
            {
                _owner = owner;

                this.X = x;
                this.Y = y;

                _control = new UserControl()
                {
                    HorizontalAlignment = HorizontalAlignment.Stretch,
                    VerticalAlignment   = VerticalAlignment.Stretch,
                    Background          = new SolidColorBrush(SeaBoard.CellBackgroundColors[SeaCellState.SEA]),
                    BorderThickness     = new Thickness(1.0),
                    BorderBrush         = Brushes.Transparent
                };
            }