private void SkinSelectListView_PreviewMouseDown(object sender, MouseButtonEventArgs e) { var item = sender as ListViewItem; if (item != null) { if (item.Tag != null) { championSkins skin = championSkins.GetSkin((int)item.Tag); SkinName.Content = skin.displayName; DoubleAnimation fadingAnimation = new DoubleAnimation(); fadingAnimation.From = 1; fadingAnimation.To = 0; fadingAnimation.Duration = new Duration(TimeSpan.FromSeconds(0.2)); fadingAnimation.Completed += (eSender, eArgs) => { string uriSource = Path.Combine(Client.ExecutingDirectory, "Assets", "champions", skin.splashPath); ChampionImage.Source = Client.GetImage(uriSource); fadingAnimation = new DoubleAnimation(); fadingAnimation.From = 0; fadingAnimation.To = 1; fadingAnimation.Duration = new Duration(TimeSpan.FromSeconds(0.5)); ChampionImage.BeginAnimation(Image.OpacityProperty, fadingAnimation); }; ChampionImage.BeginAnimation(Image.OpacityProperty, fadingAnimation); } } }
private void LoadStats() { string hi = "hi"; ChampionSelectListView.Items.Clear(); if (hi == "hi") { ChampList = new List <ChampionDTO>(Client.PlayerChampions); foreach (ChampionDTO champ in ChampList) { champions getChamp = champions.GetChampion(champ.ChampionId); if ((champ.Owned || champ.FreeToPlay)) { //Add to ListView ListViewItem item = new ListViewItem(); ChampionImage championImage = new ChampionImage(); championImage.ChampImage.Source = champions.GetChampion(champ.ChampionId).icon; if (champ.FreeToPlay) { championImage.FreeToPlayLabel.Visibility = Visibility.Visible; } championImage.Width = 64; championImage.Height = 64; item.Tag = champ.ChampionId; item.Content = championImage.Content; ChampionSelectListView.Items.Add(item); } } } }
private void SearchBox_TextChanged(object sender, TextChangedEventArgs e) { ChampionSelectListView.Items.Clear(); List <ChampionDTO> tempList = ChampList.ToList(); if (SearchTextBox.Text != "Search" && !String.IsNullOrEmpty(SearchTextBox.Text)) { tempList = tempList.Where(x => champions.GetChampion(x.ChampionId).displayName.ToLower().Contains(SearchTextBox.Text.ToLower())).ToList(); } foreach (ChampionDTO champ in tempList) { champions getChamp = champions.GetChampion(champ.ChampionId); if ((champ.Owned || champ.FreeToPlay)) { //Add to ListView ListViewItem item = new ListViewItem(); ChampionImage championImage = new ChampionImage(); championImage.ChampImage.Source = champions.GetChampion(champ.ChampionId).icon; if (champ.FreeToPlay) { championImage.FreeToPlayLabel.Visibility = Visibility.Visible; } championImage.Width = 64; championImage.Height = 64; item.Tag = champ.ChampionId; item.Content = championImage.Content; ChampionSelectListView.Items.Add(item); } } }
public SelectChampOverlay(TeamQueuePage tqp) { InitializeComponent(); Change(); this.tqp = tqp; ChampionSelectListView.Items.Clear(); if (true) { ChampList = new List <ChampionDTO>(Client.PlayerChampions); ChampList.Sort( (x, y) => String.Compare(champions.GetChampion(x.ChampionId) .displayName, champions.GetChampion(y.ChampionId).displayName, StringComparison.Ordinal)); foreach (ChampionDTO champ in ChampList) { champions getChamp = champions.GetChampion(champ.ChampionId); if ((!champ.Owned && !champ.FreeToPlay)) { continue; } //Add to ListView var item = new ListViewItem(); var championImage = new ChampionImage { ChampImage = { Source = champions.GetChampion(champ.ChampionId).icon } }; if (champ.FreeToPlay) { championImage.FreeToPlayLabel.Visibility = Visibility.Visible; } championImage.Width = 64; championImage.Height = 64; item.Tag = champ.ChampionId; item.Content = championImage.Content; ChampionSelectListView.Items.Add(item); } var items = new ListViewItem(); var img = new ChampionImage { ChampImage = { Source = Client.GetImage("getNone") }, Width = 64, Height = 64 }; items.Tag = 0; items.Content = img.Content; ChampionSelectListView.Items.Add(items); } }
/// <summary> /// Render all champions /// </summary> /// <param name="RenderBans">Render champions for ban</param> internal void RenderChamps(bool RenderBans) { ChampionSelectListView.Items.Clear(); if (!RenderBans) { foreach (ChampionDTO champ in ChampList) { champions getChamp = champions.GetChampion(champ.ChampionId); if ((champ.Owned || champ.FreeToPlay) && getChamp.displayName.ToLower().Contains(SearchTextBox.Text.ToLower())) { //Add to ListView ListViewItem item = new ListViewItem(); ChampionImage championImage = new ChampionImage(); championImage.ChampImage.Source = champions.GetChampion(champ.ChampionId).icon; if (getChamp.IsFavourite) { championImage.FavoriteImage.Visibility = Visibility.Visible; } if (champ.FreeToPlay) { championImage.FreeToPlayLabel.Visibility = Visibility.Visible; } championImage.Width = 64; championImage.Height = 64; item.Tag = champ.ChampionId; item.Content = championImage.Content; ChampionSelectListView.Items.Add(item); } } } else { foreach (ChampionBanInfoDTO champ in ChampionsForBan) { champions getChamp = champions.GetChampion(champ.ChampionId); if (champ.EnemyOwned && getChamp.displayName.ToLower().Contains(SearchTextBox.Text.ToLower())) { //Add to ListView ListViewItem item = new ListViewItem(); ChampionImage championImage = new ChampionImage(); championImage.ChampImage.Source = champions.GetChampion(champ.ChampionId).icon; championImage.Width = 64; championImage.Height = 64; item.Tag = champ.ChampionId; item.Content = championImage.Content; ChampionSelectListView.Items.Add(item); } } } }
public SelectChampOverlay(TeamQueuePage tqp) { InitializeComponent(); this.tqp = tqp; ChampionSelectListView.Items.Clear(); if (true) { ChampList = new List <ChampionDTO>(Client.PlayerChampions); ChampList.Sort((x, y) => champions.GetChampion(x.ChampionId).displayName.CompareTo(champions.GetChampion(y.ChampionId).displayName)); foreach (ChampionDTO champ in ChampList) { champions getChamp = champions.GetChampion(champ.ChampionId); if ((champ.Owned || champ.FreeToPlay)) { //Add to ListView ListViewItem item = new ListViewItem(); ChampionImage championImage = new ChampionImage(); championImage.ChampImage.Source = champions.GetChampion(champ.ChampionId).icon; if (champ.FreeToPlay) { championImage.FreeToPlayLabel.Visibility = Visibility.Visible; } championImage.Width = 64; championImage.Height = 64; item.Tag = champ.ChampionId; item.Content = championImage.Content; ChampionSelectListView.Items.Add(item); } } ListViewItem items = new ListViewItem(); ChampionImage img = new ChampionImage(); img.ChampImage.Source = Client.GetImage("getNone"); img.Width = 64; img.Height = 64; items.Tag = 0; items.Content = img.Content; ChampionSelectListView.Items.Add(items); } }