Beispiel #1
0
        private async Task ExecuteLoadDocumentsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                ContentItems.Clear();
                var contentItems = await DataStore.GetContentItemsAsync(true);

                ContentItems.ReplaceRange(contentItems);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
                MessagingCenter.Send(new MessagingCenterAlert
                {
                    Title   = "Error",
                    Message = "Unable to load content items.",
                    Cancel  = "OK"
                }, "message");
            }
            finally
            {
                IsBusy = false;
            }
        }