/// <summary> /// Get all the items for a set location /// </summary> /// <param name="location"></param> /// <returns></returns> public List <string> Get_Item_List_BasedOn_Location(string location) { ItemIndexViewModel ItemList = ItemIndexViewModel.Instance; List <string> result = new List <string>(); if (location == "Hand") { foreach (var item in ItemList.GetLocationItems(ItemLocationEnum.PrimaryHand)) { result.Add(item.Name); } } else if (location == "Head") { foreach (var item in ItemList.GetLocationItems(ItemLocationEnum.Head)) { result.Add(item.Name); } } else if (location == "Finger") { foreach (var item in ItemList.GetLocationItems(ItemLocationEnum.Finger)) { result.Add(item.Name); } } return(result); }
public void ItemIndexViewModel_GetLocationItems_Head_Should_Pass() { // Arrange // Act var result = ViewModel.GetLocationItems(ItemLocationEnum.PrimaryHand); // Reset // Assert Assert.AreNotEqual(null, result); // Update returned Pass }
/// <summary> /// Show the Popup for the Item /// </summary> /// <param name="data"></param> /// <param name="location"></param> /// <returns></returns> public bool ShowPopup(ItemModel data, ItemLocationEnum location) { // Show the Popup View PopupLoadingView.IsVisible = true; // Update the displayed selected item as the current item UpdatePopupSelectedItemValues(data); // Get List of ItemModels for list, and bind click function PopupListView.ItemsSource = new ObservableCollection <ItemModel>(ItemListModel.GetLocationItems(location)); PopupListView.ItemSelected += (sender, args) => PopupItemSelected((ItemModel)args.SelectedItem, location); return(true); }