Beispiel #1
0
        public void OnDelete(object sender, EventArgs e)
        {
            var mi = ((MenuItem)sender);
            WeekDayPageModel pageModel = (WeekDayPageModel)BindingContext;
            var product = (Food)mi.CommandParameter;

            ProductsListView.BeginRefresh();
            var result = DatabaseConnection.Connection.DeleteAsync(product);

            result.Wait();
            if (result.IsCompleted)
            {
                pageModel.RefreshList();
                ProductsListView.EndRefresh();
            }
        }
Beispiel #2
0
        private async void ProductsListView_OnRefreshing(object sender, EventArgs e)
        {
            await GetPosts();

            ProductsListView.EndRefresh();
        }