Example #1
0
        private void BtnApplyOnClick(object sender, EventArgs e)
        {
            try
            {
                switch (TypeFilter)
                {
                case "Market":
                    UserDetails.MarketDistanceCount = DistanceCount.ToString();

                    ContextMarket.MarketTab.MAdapter.MarketList.Clear();
                    ContextMarket.MarketTab.MAdapter.NotifyDataSetChanged();

                    ContextMarket.MarketTab.MainScrollEvent.IsLoading     = false;
                    ContextMarket.MarketTab.SwipeRefreshLayout.Refreshing = true;

                    PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                        () => ContextMarket.GetMarket()
                    });
                    break;

                case "NearbyShops":
                    UserDetails.NearbyShopsDistanceCount = DistanceCount.ToString();

                    ContextNearbyShops.MAdapter.NearbyShopsList.Clear();
                    ContextNearbyShops.MAdapter.NotifyDataSetChanged();

                    ContextNearbyShops.MainScrollEvent.IsLoading     = false;
                    ContextNearbyShops.SwipeRefreshLayout.Refreshing = true;

                    ContextNearbyShops.StartApiService();
                    break;

                case "NearbyBusiness":
                    UserDetails.NearbyBusinessDistanceCount = DistanceCount.ToString();

                    ContextNearbyBusiness.MAdapter.NearbyBusinessList.Clear();
                    ContextNearbyBusiness.MAdapter.NotifyDataSetChanged();

                    ContextNearbyBusiness.MainScrollEvent.IsLoading     = false;
                    ContextNearbyBusiness.SwipeRefreshLayout.Refreshing = true;

                    ContextNearbyBusiness.StartApiService();
                    break;
                }

                Dismiss();
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
Example #2
0
        private void BtnApplyOnClick(object sender, EventArgs e)
        {
            try
            {
                if (TypeFilter == "Market")
                {
                    UserDetails.MarketDistanceCount = DistanceCount.ToString();

                    ContextMarket.MarketTab.MAdapter.MarketList.Clear();
                    ContextMarket.MarketTab.MAdapter.NotifyDataSetChanged();

                    ContextMarket.MarketTab.MainScrollEvent.IsLoading     = false;
                    ContextMarket.MarketTab.SwipeRefreshLayout.Refreshing = true;

                    PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                        () => ContextMarket.GetMarket()
                    });
                }
                else if (TypeFilter == "NearbyShops")
                {
                    UserDetails.NearbyShopsDistanceCount = DistanceCount.ToString();

                    ContextNearbyShops.MAdapter.NearbyShopsList.Clear();
                    ContextNearbyShops.MAdapter.NotifyDataSetChanged();

                    ContextNearbyShops.MainScrollEvent.IsLoading     = false;
                    ContextNearbyShops.SwipeRefreshLayout.Refreshing = true;

                    ContextNearbyShops.StartApiService();
                }
                else if (TypeFilter == "NearbyBusiness")
                {
                    UserDetails.NearbyBusinessDistanceCount = DistanceCount.ToString();

                    ContextNearbyBusiness.MAdapter.NearbyBusinessList.Clear();
                    ContextNearbyBusiness.MAdapter.NotifyDataSetChanged();

                    ContextNearbyBusiness.MainScrollEvent.IsLoading     = false;
                    ContextNearbyBusiness.SwipeRefreshLayout.Refreshing = true;

                    ContextNearbyBusiness.StartApiService();
                }
                Dismiss();
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }