Ejemplo n.º 1
0
        private async void ExecuteLoadBeersCommand(bool TryRefresh)
        {
            if (IsBusy || IsRrefresh)
            {
                return;
            }

            if (TryRefresh)
            {
                IsRrefresh = true;
            }
            else
            {
                IsBusy = true;
            }


            BaseListResponse <Beer> response = await RestDataService.GetBeerList();

            if (string.IsNullOrEmpty(response.ErrorMessage))
            {
                Items.Clear();
                List <Beer> items = response.Data;
                foreach (var item in items)
                {
                    item.Visited = SettingsService.BeerWasVisited(item.Id);
                    Items.Add(item);
                }
            }
            else
            {
                ShowErrorConection(response.ErrorMessage);
            }


            IsRrefresh = false;
            IsBusy     = false;
        }