/// <summary> /// Shows the tool tip. /// </summary> /// <param name="itemContainer">The item container.</param> private void ShowToolTip(CharacterItemContainer itemContainer) { _isToolTipLoading = true; ViewModel.ItemContainerForToolTip = itemContainer; itemContainer.SelectionVisibility = Visibility.Visible; svCharacterStats.IsEnabled = false; svCharacterStats.Opacity = 0.25; pbItemToolTip.IsIndeterminate = true; pbItemToolTip.Visibility = Visibility.Visible; ShowToolTipText(tbItemToolTipLoading, AppResources.UI_Common_LoadingData); brdItemToolTip.Visibility = Visibility.Visible; ViewModel.IsItemToolTipOpen = true; _requestedItemId = ((CharacterItem)itemContainer.DataContext).Id; if (ViewModel.CachedItems.ContainsKey(((CharacterItem)itemContainer.DataContext).Id)) { OnItemReceived(ViewModel.CachedItems[((CharacterItem)itemContainer.DataContext).Id]); } else { BattleNetClient.Current.GetItemAsync(((CharacterItem)itemContainer.DataContext).Id, OnItemReceived); } }
/// <summary> /// Fetches the socket details. /// </summary> /// <param name="itemContainer">The item container.</param> /// <param name="item">The item.</param> /// <param name="index">The index.</param> private void FetchSocketDetails(CharacterItemContainer itemContainer, int index) { if (((CharacterItem)itemContainer.DataContext).TooltipParams == null) { return; } int itemId = 0; switch (index) { case 0: { itemId = ((CharacterItem)itemContainer.DataContext).TooltipParams.Gem0; } break; case 1: { itemId = ((CharacterItem)itemContainer.DataContext).TooltipParams.Gem1; } break; case 2: { itemId = ((CharacterItem)itemContainer.DataContext).TooltipParams.Gem2; } break; case 3: { itemId = ((CharacterItem)itemContainer.DataContext).TooltipParams.Gem3; } break; } if (itemId != 0) { if (!ViewModel.CachedGems.ContainsKey(itemId)) { BattleNetClient.Current.GetItemAsync(itemId, item => SocketDetailsRetrieved(item, index)); } else { SocketDetailsRetrieved(ViewModel.CachedGems[itemId], index); } } }