private async Task RefreshBucketLists()
        {
            IsBusy = true;
            //get settings, because we need current user Id
            var settings = await settingsService.GetSettings();

            //get all bucket lists for this user
            var buckets = await bucketListService.GetBucketListsForUser(settings.CurrentUserId);

            //bind IEnumerable<Bucket> to the ListView's ItemSource
            Buckets = null;    //Important! ensure the list is empty first to force refresh!
            Buckets = new ObservableCollection <Bucket>(buckets);
            IsBusy  = false;
        }
Exemple #2
0
        private async Task RefreshBucketLists()
        {
            busyIndicator.IsVisible = true;

            //get settings, because we need current user Id
            var settings = await settingsService.GetSettings();

            //get all bucket lists for this user
            var buckets = await bucketsService.GetBucketListsForUser(settings.CurrentUserId);

            //bind IEnumerable<Bucket> to the ListView's ItemSource
            lvBucketLists.ItemsSource = buckets;

            busyIndicator.IsVisible = false;
        }
        private async Task RefreshBucketLists()
        {
            IsBusy = true;
            //get settings, because we need current user Id
            var settings = await settingsService.GetSettings();

            try
            {
                //get all bucket lists for this user
                var buckets = await bucketsService.GetBucketListsForUser(settings.CurrentUserId);
                //bind IEnumerable<Bucket> to the ListView's ItemSource
                Buckets = null;    //Important! ensure the list is empty first to force refresh!
                Buckets = new ObservableCollection<Bucket>(buckets.OrderBy(e => e.Title));
            }
            catch(Exception ex)
            {
                await CoreMethods.DisplayAlert("Error", $"{ex.Message}", "Ok");
            }
            finally
            {
                IsBusy = false;
            }            
        }