Exemplo n.º 1
0
        public static MapIcon CreateMapIcon(PvPPlayer player, FrameworkElement uiElement)
        {
            if (player == null)
            {
                throw new ArgumentNullException(nameof(player));
            }

            if (uiElement == null)
            {
                throw new ArgumentNullException(nameof(uiElement));
            }

            var playerIcon = new MapIcon
            {
                BackgroundColor     = GetTeamColor(player.Team),
                PlayerIdentityColor = player.IdentityColor,
                EventContent        = uiElement,
            };
            var playerNameBinding = new Binding("Name")
            {
                Source = player,
            };

            playerIcon.SetBinding(Timeline.Parts.MapIcon.PlayerNameProperty, playerNameBinding);

            return(playerIcon);
        }