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; } } }
private void SendAddEditToBackground(Entity.PostFeed postFeed, Entity.Contact contact) { PostFeedMessage postFeedMessage = new PostFeedMessage { CurrentPost = AppUnityContainer.Instance.Resolve <IServiceMapper>().Instance.Map <Contract.PostFeedK>(postFeed), CurrentUser = AppUnityContainer.Instance.Resolve <IServiceMapper>().Instance.Map <Contract.ContactK>(contact) }; MessagingCenter.Send(postFeedMessage, "AddUpdatePostFeedToHub"); //chito. added this for FAKE only because navigating to PostFeedPage after editing a post is called only after subscribing to messaging center coming from Native. AddUpdatePostFeedToHubFake(); }
private void SendAddEditToBackground(Entity.PostFeed postFeed, Entity.Contact contact) { PostFeedMessage postFeedMessage = new PostFeedMessage { CurrentPost = AppUnityContainer.Instance.Resolve <IServiceMapper>().Instance.Map <Contract.PostFeedK>(postFeed), CurrentUser = AppUnityContainer.Instance.Resolve <IServiceMapper>().Instance.Map <Contract.ContactK>(contact) }; //_eventAggregator.GetEvent<AddUpdatePostFeedToHubEventModel>().Publish(postFeedMessage); // 01-12-2018 12:06pm REYNZ: // added this for FAKE only because navigating to PostFeedPage after editing // a post is called only after subscribing to messaging center coming from // Native. AddUpdatePostFeedToHubFake(); }
private void DeleteSelfComment() { if (!ProcessInternetConnection(true)) { return; } PostFeedMessage postFeedMessage = new PostFeedMessage { CurrentPost = AppUnityContainer.Instance.Resolve <IServiceMapper>().Instance.Map <Contract.PostFeedK>(Comment), CurrentUser = AppUnityContainer.Instance.Resolve <IServiceMapper>().Instance.Map <Contract.ContactK>(CurrentContact) }; DeletingMessage = AppStrings.DeletingComment; MessagingCenter.Send(postFeedMessage, "DeletePostFeedToHub"); DeletePostFeedFromLocal(Comment); }
private void DeleteSelfComment() { if (!ProcessInternetConnection(true)) { return; } PostFeedMessage postFeedMessage = new PostFeedMessage { CurrentPost = AppUnityContainer.Instance.Resolve <IServiceMapper>().Instance.Map <Contract.PostFeedK>(Comment), CurrentUser = AppUnityContainer.Instance.Resolve <IServiceMapper>().Instance.Map <Contract.ContactK>(CurrentContact) }; DeletingMessage = AppStrings.DeletingComment; _eventAggregator.GetEvent <DeletePostFeedToHubEventModel>().Publish(postFeedMessage); DeletePostFeedFromLocal(Comment); }