Beispiel #1
0
        async void AddItem_Clicked(object sender, System.EventArgs e)
        {
            var itemDetaiLView = new ItemDetailView(new GroceryItem());

            itemDetaiLView.ListExistingItems = Items.ToList();
            itemDetaiLView.ItemAdded        += AddItem;
            await Navigation.PushModalAsync(itemDetaiLView);
        }
Beispiel #2
0
        async void OnEditItem(object sender, System.EventArgs e)
        {
            var menuItem     = sender as MenuItem;
            var itemToUpdate = menuItem.CommandParameter as ItemDetail;

            if (itemToUpdate != null)
            {
                var itemDetaiLView = new ItemDetailView(itemToUpdate.GroceryItem);
                itemDetaiLView.IsEditing    = true;
                itemDetaiLView.ItemUpdated += UpdateItem;
                await Navigation.PushModalAsync(itemDetaiLView);

                //Deselect Item
                itemListView.SelectedItem = null;
            }
        }