public void PopulateNameplates(DestinyPlayerData data)
 {
     Characters.Clear();
     foreach (var nameplate in data.CharacterNameplates)
     {
         Characters.Add(nameplate);
     }
 }
Exemplo n.º 2
0
        public void PopulateActivityHistory(DestinyPlayerData playerData)
        {
            var activitySources = new List <ObservableCollection <PgcrCardViewModel> >
            {
                Char1ActivityHistory, Char2ActivityHistory, Char3ActivityHistory
            };
            var nameplates = new List <CharacterNameplateViewModel>
            {
                Character1, Character2, Character3
            };

            SelectedCharacter = 1;

            var adaptiveCardRenderer = new AdaptiveCardRenderer
            {
                HostConfig = new AdaptiveHostConfig
                {
                    FontFamily = "Segoe UI",
                    FontSizes  = new AdaptiveFontSizesConfig
                    {
                        Small      = 12,
                        Default    = 14,
                        Large      = 20,
                        ExtraLarge = 24
                    },
                    FontWeights = new AdaptiveFontWeightsConfig
                    {
                        Lighter = 200,
                        Default = 400,
                        Bolder  = 700
                    },
                    ContainerStyles = new AdaptiveContainerStylesDefinition
                    {
                        Default = new AdaptiveContainerStyleDefinition
                        {
                            BackgroundColor  = Color.FromArgb(255, 83, 84, 84),
                            ForegroundColors = new AdaptiveColorsConfig
                            {
                                Default = new AdaptiveColorConfig
                                {
                                    Default = Color.FromArgb(255, 255, 255, 255),
                                    Subtle  = Color.FromArgb(255, 156, 158, 159)
                                },
                                Attention = new AdaptiveColorConfig
                                {
                                    Default = Color.FromArgb(255, 255, 0, 0),
                                    Subtle  = Color.FromArgb(221, 255, 0, 0)
                                },
                                Good = new AdaptiveColorConfig
                                {
                                    Default = Color.FromArgb(255, 0, 255, 0),
                                    Subtle  = Color.FromArgb(221, 0, 255, 0)
                                }
                            }
                        }
                    },
                    ImageSizes = new AdaptiveImageSizesConfig
                    {
                        Small  = 40,
                        Medium = 80,
                        Large  = 120
                    },
                    ImageSet = new AdaptiveImageSetConfig
                    {
                        ImageSize      = ImageSize.Medium,
                        MaxImageHeight = 100
                    }
                }
            };

            foreach (var activitySource in activitySources)
            {
                activitySource.Clear();
            }
            foreach (var nameplate in nameplates)
            {
                nameplate.ClearProperties();
            }

            for (int i = 0; i < playerData.CharacterNameplates.Count; i++)
            {
                nameplates[i].ElementVisibility = playerData.CharacterNameplates[i].ElementVisibility;
                nameplates[i].ClassName         = playerData.CharacterNameplates[i].ClassName;
                nameplates[i].Race   = playerData.CharacterNameplates[i].Race;
                nameplates[i].Gender = playerData.CharacterNameplates[i].Gender;
                nameplates[i].Level  = playerData.CharacterNameplates[i].Level;
                nameplates[i].Power  = playerData.CharacterNameplates[i].Power;
                nameplates[i].Emblem = playerData.CharacterNameplates[i].Emblem;

                if (playerData.ActivityHistoryLists[i].Count == 0)
                {
                    activitySources[i].Add(null);
                }
                else
                {
                    foreach (var pgcr in playerData.ActivityHistoryLists[i])
                    {
                        activitySources[i].Add(pgcr);
                    }
                }
            }
        }