public async void Load() { SolidColorBrush solidColor = new SolidColorBrush(); solidColor.Color = game.Stats.Win ? Colors.Green : Colors.Red; solidColor.Opacity = 0.5; LayoutRoot.Background = solidColor; textBlockAbates.Text += game.Stats.ChampionsKilled.ToString(); textBlockMortes.Text += game.Stats.NumDeaths.ToString(); textBlockAssistencias.Text += game.Stats.Assists.ToString(); textBlockFarm.Text += game.Stats.MinionsKilled.ToString(); textBlockOuro.Text += game.Stats.GoldEarned.ToString(); textBlockTempo.Text += ((int)(game.Stats.TimePlayed / 60)).ToString(); textBlockModo.Text += game.SubType; ChampionDto champion = await ChampionDto.SearchChampionLowData(game.ChampionId); this.imageChampion.Source = await champion.GetChampionSquare(); List <int> idItems = new List <int>() { game.Stats.Item0, game.Stats.Item1, game.Stats.Item2, game.Stats.Item3, game.Stats.Item4, game.Stats.Item5, game.Stats.Item6 }; for (int i = 0; i < 7; i++) { try { if (idItems[i] != 0) { ItemDto item = await new ItemDto().SearchItemLowData(idItems[i]); ImageBrush brush = new ImageBrush(); brush.ImageSource = await item.GetImage(); ((Ellipse)itemsMatch.Children[i]).Fill = brush; } else { ((Ellipse)itemsMatch.Children[i]).Stroke = new SolidColorBrush(SystemColors.ActiveBorderColor); } }catch {} } }
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(); } }
private async void LoadImage() { imageSquareChampion.Source = await champion.GetChampionSquare(); }
private async void LoadIcon() { this.icon.Source = await champion.GetChampionSquare(); }