示例#1
0
            public static Map CreateTiles()
            {
                LoadImage();
                InitMap();
                LoadMap();

                CreateProvinces();
                CreateCities();

                InitCities();

                Map.CalcHeightAndWidth();
                DragHandler.MakeDragable(Map, true);

                return(Map);
            }
示例#2
0
        protected virtual void LoadGrid()
        {
            Border = new Border
            {
                Background      = Brushes.DarkGray,
                BorderThickness = new Thickness(3),
                BorderBrush     = Brushes.Black,
                CornerRadius    = new CornerRadius(6, 6, 3, 3)
            };
            Children.Add(Border);

            FullGrid     = new Grid();
            Border.Child = FullGrid;

            TopGrid = new Grid
            {
                Background        = ColorHandler.ColorFromHex("#7F000000"),
                VerticalAlignment = VerticalAlignment.Top,
                Height            = 35,
                Margin            = new Thickness(0, 15, 0, 0)
            };
            FullGrid.Children.Add(TopGrid);

            WindowIcon = new Image
            {
                Margin = new Thickness(10, 0, 0, 0),
                HorizontalAlignment = HorizontalAlignment.Left
            };
            TopGrid.Children.Add(WindowIcon);

            WindowName = new Label
            {
                Padding = new Thickness(0),
                VerticalContentAlignment   = VerticalAlignment.Center,
                HorizontalContentAlignment = HorizontalAlignment.Center,
                FontWeight          = FontWeights.Bold,
                FontSize            = 18,
                Margin              = new Thickness(0),
                Foreground          = Brushes.White,
                HorizontalAlignment = HorizontalAlignment.Center,
                FontFamily          = new FontFamily("Arial")
            };
            TopGrid.Children.Add(WindowName);

            Button btn_exit = new Button
            {
                HorizontalAlignment        = HorizontalAlignment.Right,
                Background                 = null,
                BorderBrush                = null,
                Padding                    = new Thickness(0),
                HorizontalContentAlignment = HorizontalAlignment.Stretch,
                VerticalContentAlignment   = VerticalAlignment.Stretch,
                Width  = 35,
                Height = 35,
                Margin = new Thickness(0, 0, 10, 0)
            };

            btn_exit.Click += Exit;
            TopGrid.Children.Add(btn_exit);

            Border btn_border = new Border
            {
                BorderBrush     = Brushes.Black,
                Background      = ColorHandler.ColorFromHex("#FF666666"),
                BorderThickness = new Thickness(1),
                CornerRadius    = new CornerRadius(15)
            };

            btn_exit.Content = btn_border;

            Label lbl_border = new Label
            {
                Content = "X",
                Padding = new Thickness(0),
                VerticalContentAlignment   = VerticalAlignment.Center,
                HorizontalContentAlignment = HorizontalAlignment.Center,
                FontWeight = FontWeights.Bold,
                FontSize   = 18
            };

            btn_border.Child = lbl_border;

            //- Additional Load
            SetIcon(Images.IconQuestionmark);
            DragHandler.MakeDragable(this);
        }