Inheritance: RequestLike
Example #1
0
        async public Task <ResponseComments> GetComments(RequestComments request)
        {
            var response = await CallService <ResponseComments, RequestComments> (Settings.URL_GET_COMMENTS, HttpMethod.Post, request);

            return(response);
        }
		protected async Task DoRefreshCommentsCommand() {
			if (Status == NetworkStatus.NotReachable) {//true || 
				ShowErrorMessage (Settings.MSG_NETWORK_NOT_REACHABLE);
				return;
			}

			IsLoading = true;

			var req = new RequestComments(Post.Id);
			try{
				var response = await Service.GetComments (req);

				var ref_comments = response.Comments;
				ObservableCollection<Comment> _Comments = new ObservableCollection<Comment>();

				foreach (Comment c in ref_comments) {
					c.Content = GetCommentText(c);
					_Comments.Add(c);
				}

				Comments.Clear();
				Comments = _Comments;
				RaisePropertyChanged(()=>Comments);
			} catch (Exception e){
				Debug.WriteLine (e);
				ShowErrorMessage (Settings.MSG_NETWORK_COMMON, e);
				return;
			}

			IsLoading = false;
		}