Esempio n. 1
0
        private void InitializeBrush(EnemyCamp camp)
        {
            CampTypeBrushConverter converter = new CampTypeBrushConverter();

            m_brush = converter.Convert(camp.CampType, typeof(Brush), null, CultureInfo.InvariantCulture) as Brush;
            InvalidateVisual();
        }
Esempio n. 2
0
        // Be sure to call the base class constructor.
        public SimpleSquareAdorner(UIElement adornedElement, EnemyCamp camp)
            : base(adornedElement)
        {
            m_camp = camp;
            m_camp.PropertyChanged += CampPropertyChanged;

            InitializeSquadPropertyChanged();

            InitializeTooltip(camp);
            InitializeBrush(camp);
        }
Esempio n. 3
0
        private void InitializeTooltip(EnemyCamp camp)
        {
            ToolTip    toolTip = new ToolTip();
            StackPanel panel   = new StackPanel();

            panel.Orientation = Orientation.Horizontal;
            panel.Children.Add(new Label {
                Content = camp.Name, VerticalAlignment = VerticalAlignment.Center, FontWeight = FontWeights.Bold
            });
            foreach (UnitSquad squad in camp.Squads)
            {
                panel.Children.Add(new Image {
                    Source = squad.Icon, VerticalAlignment = VerticalAlignment.Center, Height = 30
                });
                panel.Children.Add(new Label {
                    Content = squad.Count, VerticalAlignment = VerticalAlignment.Center
                });
            }

            toolTip.Content = panel;
            ToolTip         = toolTip;
        }