/** * Clear then recreate all Views. */ public void Reset() { _friendlyPanel.Children.Clear(); Mulligan = new MulliganView { Label = { Visibility = Visibility.Hidden } }; _friendlyPanel.Children.Add(Mulligan); }
private void SetUpWinrates() { Reset(); var shortId = ShortIdHelper.GetShortId(DeckList.Instance.ActiveDeck); //check to see if shortId is in the hsreplay_decks.cache if so go get data var pos = Array.IndexOf(HsReplayDataManager.Decks.AvailableDecks, shortId); var has = pos >= 0; if (has) { _winrates = CreateWinRatesDictionary(shortId); foreach (int key in _winrates.Keys) { Mulligan.Update(new Card(Cards.GetFromDbfId(key)), _winrates); } Mulligan = new MulliganView { Label = { Visibility = Visibility.Hidden } }; var label = new HearthstoneTextBlock { FontSize = 16, TextAlignment = TextAlignment.Center, Text = "Deck Winrate: " + _deckWinrate }; var margin = label.Margin; margin.Top = 20; label.Margin = margin; Mulligan.Children.Add(label); _friendlyPanel.Children.Add(Mulligan); Mulligan.Visibility = Visibility.Visible; Mulligan.MulliganWinratesCardList.Visibility = Visibility.Visible; Mulligan.Label.Visibility = Visibility.Visible; } //foreach (var winrate in _winrates.Keys) //{ // Mulligan.Update(new Card(HearthDb.Cards.GetFromDbfId(winrate)),_winrates ); //} }