Task ReloadBeers()
        {
            Beers.Clear();
            LastLoadedPage = 0;

            return(LoadMoreBeers());
        }
Example #2
0
        public void SetBeers(IEnumerable <Beer> inBeers)
        {
            Beers.Clear();

            foreach (var beer in inBeers)
            {
                Beers.Add(new BeerViewModel(beer));
            }

            RefreshFilter();
        }
Example #3
0
        private async Task SearchBeer(string query)
        {
            IsBusy = true;

            Beers.Clear();
            var beers = await _untappdService.SearchBeer(query);

            foreach (var beer in beers)
            {
                Beers.Add(beer);
            }

            IsBusy = false;
        }
Example #4
0
        private async Task ExecuteSearchBeersCommand()
        {
            if (IsBusy)
            {
                return;
            }

            using (Insights.TrackTime("BeerSearch", "searchTerm", SearchTerm))
            {
                _userDialogs.ShowLoading("Searching...");

                IsBusy     = true;
                IsSearched = true;

                try
                {
                    var results = await _beerDrinkinClient.SearchBeersAsync(SearchTerm);

                    Beers.Clear();

                    if (results?.Count > 0)
                    {
                        foreach (var beer in results)
                        {
                            Beers.Add(beer);
                        }
                    }

                    _userDialogs.HideLoading();
                }
                catch (Exception ex)
                {
                    _userDialogs.ShowError(ex.Message);
                }
                finally
                {
                    IsBusy = false;
                }
            }
        }