Ejemplo n.º 1
0
        private void SetBoardLayout()
        {
            var board = new Rectangle()
            {
                Fill = new SolidColorBrush()
                {
                    Color = Colors.RosyBrown
                },
                StrokeThickness = 10
            };

            Grid.SetRowSpan(board, 5);
            Grid.SetColumnSpan(board, 15);
            ImplementOptionsForGrid.AddToGrid(board, 0, 0, BoardGame);

            OutBarRedPlayer = new Grid()
            {
                Background = new SolidColorBrush()
                {
                    Color = Colors.Brown
                },
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment   = VerticalAlignment.Center,
                Width  = 20,
                Height = 150
            };
            ImplementOptionsForGrid.CreateRowsForGrid(15, OutBarRedPlayer, null);
            ImplementOptionsForGrid.AddToGrid(OutBarRedPlayer, 1, 14, BoardGame);
            OutBarRedPlayer.MouseLeftButtonDown += OutBarRedPlayer_Click;

            OutBarBlackPlayerar = new Grid()
            {
                Background = new SolidColorBrush()
                {
                    Color = Colors.Brown
                },
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment   = VerticalAlignment.Center,
                Width  = 20,
                Height = 150
            };
            ImplementOptionsForGrid.CreateRowsForGrid(15, OutBarBlackPlayerar, null);
            ImplementOptionsForGrid.AddToGrid(OutBarBlackPlayerar, 3, 14, BoardGame);
            OutBarBlackPlayerar.MouseLeftButtonDown += OutBarBlackPlayerar_Click;

            Bar.Grid.MouseLeftButtonDown += Bar_Click;
            ImplementOptionsForGrid.AddToGrid(Bar.Grid, 2, 7, BoardGame);

            ImplementOptionsForGrid.AddToGrid(GetNewTriangleBoard(), 1, 1, BoardGame);
            ImplementOptionsForGrid.AddToGrid(GetNewTriangleBoard(), 1, 8, BoardGame);
        }
Ejemplo n.º 2
0
        private void SetTriangle()
        {
            int index = 0;

            for (int j = 14; j >= 0; j--)
            {
                switch (j)
                {
                case 0:
                    break;

                case 7:
                    break;

                case 14:
                    break;

                default:
                    ImplementOptionsForGrid.AddToGrid(List[index].Path, 3, j, BoardGame);
                    ImplementOptionsForGrid.AddToGrid(List[index++].StackPanel, 3, j, BoardGame);
                    break;
                }
            }
            for (int j = 0; j < 15; j++)
            {
                switch (j)
                {
                case 0:
                    break;

                case 7:
                    break;

                case 14:
                    break;

                default:
                    ImplementOptionsForGrid.AddToGrid(List[index].Path, 1, j, BoardGame);
                    ImplementOptionsForGrid.AddToGrid(List[index++].StackPanel, 1, j, BoardGame);
                    break;
                }
            }
        }
Ejemplo n.º 3
0
        public BarViewModel()
        {
            Grid = new Grid()
            {
                Background = new SolidColorBrush {
                    Color = Colors.Brown
                }
            };

            RedAmount = new TextBlock {
                Foreground = new SolidColorBrush {
                    Color = Colors.White
                }, TextAlignment = TextAlignment.Center
            };
            BlackAmount = new TextBlock {
                Foreground = new SolidColorBrush {
                    Color = Colors.Black
                }, TextAlignment = TextAlignment.Center
            };

            ImplementOptionsForGrid.CreateCoulmnsForGrid(2, Grid);
            ImplementOptionsForGrid.AddToGrid(RedAmount, 0, 0, Grid);
            ImplementOptionsForGrid.AddToGrid(BlackAmount, 0, 1, Grid);
        }