Exemplo n.º 1
0
        public async Task GetPhotos()
        {
            if (IsBusy)
            {
                return;
            }

            Exception error = null;

            try
            {
                IsBusy = true;
                var items = await mobileService.GetPhotos();

                Photos.Clear();
                foreach (var item in items)
                {
                    Photos.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Error: " + ex);
                error = ex;
            }
            finally
            {
                IsBusy = false;
            }

            if (error != null)
            {
                dialogService.ShowError("Error! " + error.Message + " OK");
            }
        }