Ejemplo n.º 1
0
        private async void LoadComments(int?id)
        {
            CommentList.Clear();

            try
            {
                List <Comment> comments = await dataRetriever.GetCommentAsync(id);

                foreach (Comment c in comments)
                {
                    CommentList.Add(c);

                    if (CommentList.Count > 0)
                    {
                        CommentsLoaderIndicator.IsRunning = false;
                        CommentsLoaderIndicator.IsVisible = false;
                    }
                }
            }
            catch (System.Net.WebException e)
            {
                CommentsLoaderIndicator.IsRunning = false;
                CommentsLoaderIndicator.IsVisible = false;
                await DisplayAlert("Alert", "Please check your internet connection", "OK");
            }
        }