public async void OnCategoryTapped(object sender, EventArgs e) { var categoryChoosed = sender as RadBorder; if (categoryChoosed.BackgroundColor == BGColorActive) { return; } loadingPopup.IsVisible = true; //set all category style to inactive RadBorder inactiveItem = (RadBorder)this.CategoriesStackLayout.Children[currentIndex]; inactiveItem.BackgroundColor = BGColorInActive; inactiveItem.BorderColor = BorderColorInActive; this.currentIndex = CategoriesStackLayout.Children.IndexOf(categoryChoosed); //set active style to category choosed SetCategoryActiveStyle(categoryChoosed); //get category choosed var tap = categoryChoosed.GestureRecognizers[0] as TapGestureRecognizer; Guid categoryId; if (tap.CommandParameter != null) { categoryId = (Guid)tap.CommandParameter; } //get list product by category choosed if (tap.CommandParameter == null) { viewModel.FilterModel.ParentCategoryId = null; } else { viewModel.FilterModel.ParentCategoryId = categoryId; } await viewModel.LoadOnRefreshCommandAsync(); loadingPopup.IsVisible = false; }
private async void PickerPost_Clicked(object sender, EventArgs e) { loadingPopup.IsVisible = true; if (searchPageResultViewModel == null) // chua bat popup lan nao. { this.ListView0.ItemTapped += ListView0_ItemTapped; searchPageResultViewModel = new FilterFurnitureProductViewModel(); searchPageResultViewModel.FilterModel.CreatedById = Guid.Parse(UserLogged.Id); this.ListView0.BindingContext = searchPageResultViewModel; await searchPageResultViewModel.LoadData(); } else { searchPageResultViewModel.FilterModel.Keyword = null; ModalPopupSearchBar.Text = null; await searchPageResultViewModel.LoadOnRefreshCommandAsync(); } loadingPopup.IsVisible = false; await ModalPickProduct.Show(); }