private void SupportPost(Entity.PostFeed SelectedPost) { var updatedSelectedPost = _postFeedManager.GetPostFeed(SelectedPost.PostFeedID); if (ProcessInternetConnection(true)) { PostFeedMessage postFeedMessage = new PostFeedMessage { CurrentPost = AppUnityContainer.Instance.Resolve <IServiceMapper>().Instance.Map <Contract.PostFeedK>(updatedSelectedPost), CurrentUser = AppUnityContainer.Instance.Resolve <IServiceMapper>().Instance.Map <Contract.ContactK>(CurrentContact) }; MessagingCenter.Send(postFeedMessage, "LikeOrUnlikePostFeedToHub"); SelectedPost.IsSelfSupported = !SelectedPost.IsSelfSupported; var updatePostFeed = _postFeedManager.UpdatePostFeedAndPostFeedLikeToLocal(updatedSelectedPost, CurrentContact); if (CurrentPostFeed.Equals(updatedSelectedPost)) { CurrentPostFeed = updatePostFeed; } else { SelectedComment = updatePostFeed; } } }
private void SupportPost() { var updatedSelectedPost = _postFeedManager.GetPostFeed(CurrentPostFeed.PostFeedID); if (ProcessInternetConnection(true)) { PostFeedMessage postFeedMessage = new PostFeedMessage { CurrentPost = AppUnityContainer.Instance.Resolve <IServiceMapper>().Instance.Map <Contract.PostFeedK>(updatedSelectedPost), CurrentUser = AppUnityContainer.Instance.Resolve <IServiceMapper>().Instance.Map <Contract.ContactK>(CurrentContact) }; _eventAggregator.GetEvent <LikeOrUnlikePostFeedToHubEventModel>().Publish(postFeedMessage); CurrentPostFeed.IsSelfSupported = !CurrentPostFeed.IsSelfSupported; RaisePropertyChanged(nameof(CurrentPostFeed.IsSelfSupported)); var updatePostFeed = _postFeedManager.UpdatePostFeedAndPostFeedLikeToLocal(updatedSelectedPost, CurrentContact); if (CurrentPostFeed.Equals(updatedSelectedPost)) { CurrentPostFeed = updatePostFeed; } else { SelectedComment = updatePostFeed; } } }