Exemplo n.º 1
0
        private async void OnCategoryTapped(object sender, EventArgs e)
        {
            var categoryChoosed = sender as RadBorder;

            if (categoryChoosed.BackgroundColor == BGColorActive)
            {
                return;
            }

            loadingPopup.IsVisible = true;

            //set active style to category choosed
            SetCategoryActiveStyle(categoryChoosed);

            //get category choosed
            var tap = categoryChoosed.GestureRecognizers[0] as TapGestureRecognizer;


            //get list product by category choosed
            if (tap.CommandParameter == null)
            {
                //get all product
                viewModel.FilterModel.CategoryId = null;
            }
            else
            {
                int categoryId = (int)tap.CommandParameter;
                //get product by categoryId
                viewModel.FilterModel.CategoryId = categoryId;
            }

            await viewModel.LoadOnRefreshCommandAsync();

            loadingPopup.IsVisible = false;
        }
Exemplo n.º 2
0
        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 LiquidationFilterViewModel();
                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();
        }
        private async void FilterByStatus_Clicked(object sender, EventArgs e)
        {
            RadBorder radBoder = sender as RadBorder;

            if (radBoder.BackgroundColor == Color.FromHex("#eeeeee"))
            {
                return;
            }

            TapGestureRecognizer tapGestureRecognizer = radBoder.GestureRecognizers[0] as TapGestureRecognizer;

            if (tapGestureRecognizer.CommandParameter != null)
            {
                int Status = int.Parse(tapGestureRecognizer.CommandParameter.ToString());
                viewModel.FilterModel.Status = Status;
            }
            else
            {
                viewModel.FilterModel.Status = null;
            }
            loadingPopup.IsVisible = true;


            // inactive
            foreach (RadBorder item in StackLayoutFilter.Children)
            {
                item.BorderColor     = Color.FromHex("#eeeeee");
                item.BackgroundColor = Color.White;
            }
            // active.
            radBoder.BackgroundColor = Color.FromHex("#eeeeee");
            radBoder.BorderColor     = Color.FromHex("#aaaaaa");



            await viewModel.LoadOnRefreshCommandAsync();

            loadingPopup.IsVisible = false;
        }