Beispiel #1
0
        private async void ExecuteLoadStoryCommentCommand(List <long> ids)
        {
            if (IsBusy)
            {
                return;
            }
            IsBusy = true;
            try
            {
                var storiesDb = storyCommentsRepository.GetAll(ids);
                foreach (var story in storiesDb)
                {
                    CommentItems.Add(story);
                }

                var comments = await storyService.GetCommentList(ids);

                CommentItems.Clear();
                foreach (var comment in comments)
                {
                    CommentItems.Add(comment);
                }
            }
            catch (Exception exception)
            {
                await crashReportService.ReportException(exception);
            }
            finally
            {
                IsBusy = false;
            }
        }
Beispiel #2
0
        private async Task ExecuteLoadStoryCommand()
        {
            if (IsBusy)
            {
                return;
            }
            IsBusy = true;
            try
            {
                StoryItems.Clear();
                var storiesDb = _storyRepository.GetAll();
                foreach (var story in storiesDb)
                {
                    StoryItems.Add(story);
                }


                var stories = await _storyService.GetStoryList();

                StoryItems.Clear();
                foreach (var story in stories)
                {
                    StoryItems.Add(story);
                }
            }
            catch (Exception exception)
            {
                await _crashReportService.ReportException(exception);
            }
            finally
            {
                IsBusy = false;
            }
        }