internal void RemoveItem(AddCell item) { Item itemToRemove = null; if (Application.Current.Properties.ContainsKey("Items")) { allItems = (List <Item>)Application.Current.Properties["Items"]; itemToRemove = allItems.First(x => x.Name == item.Text); allItems.Remove(itemToRemove); } App.Database.RemoveItem(itemToRemove); addView.ItemsSource = UpdateAddItemsList(); }
internal void BuyItem(AddCell item) { if (Application.Current.Properties.ContainsKey("Items")) { allItems = (List <Item>)Application.Current.Properties["Items"]; var obj = allItems.First(x => x.Name == item.Text); if (obj != null) { obj.Buy = true; } App.Database.UpdateItem((Item)obj); } addView.ItemsSource = UpdateAddItemsList(); MessagingCenter.Send <AddPage>(this, "UpdateBuyItemsList"); }