Esempio n. 1
0
        private async void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            if (!carregado)
            {
                ChampionDto champion = new ChampionDto();
                champion = await ChampionDto.SearchChampionAllData(Convert.ToInt32(NavigationContext.QueryString["id"]));

                iconChampion.Source = await champion.GetChampionSquare();

                Random      randNumSkin  = new Random();
                int         num          = randNumSkin.Next(champion.Skins.Count);
                BitmapImage backGridInfo = champion.GetChampionSplash(num);
                ImageBrush  brush        = new ImageBrush();
                brush.Stretch               = Stretch.UniformToFill;
                brush.ImageSource           = backGridInfo;
                panorama.Background         = brush;
                panorama.Background.Opacity = 0.5;
                championName.Text           = champion.Name;
                TextBlock loreDescription = new TextBlock();
                lore.Text = Code.HtmlRemoval.StripTagsCharArray(champion.Lore);
                AddInfoComponent(champion.AllyTips, allytips);
                AddInfoComponent(champion.EnimyTips, enimytips);
                attackInfo.Value     = champion.Info.Attack;
                defenseInfo.Value    = champion.Info.Defense;
                magicInfo.Value      = champion.Info.Magic;
                difficultyInfo.Value = champion.Info.Difficulty;
                //incluir habilidades
                foreach (ChampionSpellDto spell in champion.Spells)
                {
                    ControlAbillity controlAbillity = new ControlAbillity(spell);
                    abillityChampions.Children.Add(controlAbillity);
                }
                CarregarComentarios();
                CarregarCounters();
            }
        }