public override void PreparingPageBindings() { if (PassingParameters != null && PassingParameters.ContainsKey("CurrentContact")) { CurrentContact = (Contact)PassingParameters["CurrentContact"]; } if (PassingParameters != null && PassingParameters.ContainsKey("SelectedPost")) { OldPost = (PostFeed)PassingParameters["SelectedPost"]; Content = OldPost.ContentText; ButtonText = AppStrings.UpdateText; } else { Content = ""; ButtonText = AppStrings.PostText; } if (IsInternetConnected) { MessagingCenter.Send(new PostFeedMessage { CurrentUser = AppUnityContainer.Instance.Resolve <IServiceMapper>().Instance.Map <Contract.ContactK>(CurrentContact) }, "LogonPostFeedToHub"); } IsBusy = false; }
public override void PreparingPageBindings() { if (PassingParameters != null && PassingParameters.ContainsKey("ItemSelected")) { ItemDetails = ((Entity.Wiki)PassingParameters["ItemSelected"]).Content; } IsBusy = false; }
public override void PreparingPageBindings() { if (PassingParameters != null && PassingParameters.ContainsKey("ComingFromLogin")) { FromLogonPage = (bool)PassingParameters["ComingFromLogin"]; } IsBusy = false; FacebookLogonCompletedFake(); }
public override void PreparingPageBindings() { if (PassingParameters != null && PassingParameters.ContainsKey("VerificationCode")) { VerificationCode = PassingParameters["VerificationCode"].ToString(); } if (PassingParameters != null && PassingParameters.ContainsKey("EmailAddress")) { emailAddress = PassingParameters["EmailAddress"].ToString(); } IsBusy = false; }
public override void PreparingPageBindings() { if (!(PassingParameters != null && PassingParameters.ContainsKey("CurrentContact"))) { throw new ArgumentException("CurrentContact parameter was null in the account registration page"); } CurrentContact = (Entity.Contact)PassingParameters["CurrentContact"]; EmailAddress = CurrentContact.EmailAdd; HasPicture = true; Picture = (CurrentContact.GenderCode.ToLower() == "male") ? picDefaultMale : picDefaultFemale; EmailEnabled = (!string.IsNullOrEmpty(EmailAddress)) ? false : true; PredefinedAvatars = Model.AppImages.Avatars; IsBusy = false; }
public override void PreparingPageBindings() { _eventAggregator.GetEvent <AddUpdatePostFeedToHubResultCodeEventModel>().Subscribe((message) => { IsBusy = false; if (message.HttpStatusCode == HttpStatusCode.OK) { Device.BeginInvokeOnMainThread(async() => { _keyValueCacheUtility.GetUserDefaultsKeyValue("IsForceToGetFromRest", "true"); _keyValueCacheUtility.GetUserDefaultsKeyValue("SecondsDelay", "2"); await NavigateBackHelper(PassingParameters); }); } else { UserDialogs.Instance.Alert(AppStrings.LoadingErrorPostFeed, "Error", "Ok"); } }); if (PassingParameters != null && PassingParameters.ContainsKey("CurrentContact")) { CurrentContact = (Contact)PassingParameters["CurrentContact"]; } if (PassingParameters != null && PassingParameters.ContainsKey("SelectedPost")) { OldPost = (PostFeed)PassingParameters["SelectedPost"]; Content = OldPost.ContentText; ButtonText = AppStrings.UpdateText; } else { Content = ""; ButtonText = AppStrings.PostText; } if (IsInternetConnected) { _eventAggregator.GetEvent <LogonPostFeedToHubEventModel>().Publish(new PostFeedMessage { CurrentUser = AppUnityContainer.Instance.Resolve <IServiceMapper>().Instance.Map <Contract.ContactK>(CurrentContact) }); } IsBusy = false; }
public override void PreparingPageBindings() { if (PassingParameters != null && PassingParameters.ContainsKey("SelectedPost")) { CurrentPostFeed = (Entity.PostFeed)PassingParameters["SelectedPost"]; if (!string.IsNullOrEmpty(CurrentPostFeed.ContentURL)) { HasPostedImage = true; } CurrentContact = (Entity.Contact)PassingParameters["CurrentUser"]; } if (IsInternetConnected) { MessagingCenter.Send(new PostFeedMessage { CurrentUser = AppUnityContainer.Instance.Resolve <IServiceMapper>().Instance.Map <Contract.ContactK>(CurrentContact) }, "LogonPostFeedToHub"); } IsWritePostEnabled = true; IsBusy = false; DeletingMessage = ""; }
public override void PreparingPageBindings() { try { if (!(PassingParameters != null && PassingParameters.ContainsKey(nameof(CurrentContact)))) { throw new ArgumentException("CurrentContact parameter was null in the account registration page"); } CurrentContact = (Entity.Contact)PassingParameters[nameof(CurrentContact)]; HasPicture = true; CurrentContact.PhotoURL = (CurrentContact.GenderCode.ToLower() == "male") ? picDefaultMale : picDefaultFemale; EmailEnabled = (!string.IsNullOrEmpty(CurrentContact.EmailAdd)) ? false : true; PredefinedAvatars = AppImages.Avatars; } catch (Exception ex) { ProcessErrorReportingForRaygun(ex); } finally { IsBusy = false; } }
public override void PreparingPageBindings() { _eventAggregator.GetEvent <LikeOrUnLikeAPostFeedSubsEventModel>().Subscribe((message) => { try { if (!IsBusy) { HasIncomingLike = true; var currentPost = AppUnityContainer.Instance.Resolve <IServiceMapper>().Instance.Map <PostFeed>(message.CurrentPost); var posterUser = AppUnityContainer.Instance.Resolve <IServiceMapper>().Instance.Map <Contact>(message.CurrentUser); SelectedComment = currentPost; if (ReadPostFeedFromLocal(currentPost) != null) { AddDeductOneLikeToThisPostFromLocal(currentPost, posterUser); } } } catch (Exception ex) { ProcessErrorReportingForRaygun(ex); } }); _eventAggregator.GetEvent <AddUpdatePostFeedToHubResultCodeEventModel>().Subscribe((message) => { IsBusy = false; if (message.HttpStatusCode == HttpStatusCode.OK) { IsWritePostEnabled = true; var newlyAddedComment = ServiceMapper.Instance.Map <PostFeed>(message.Result); LatestPostUpdatedPostFeedId = newlyAddedComment.PostFeedID; _postFeedManager.SaveNewPostToLocal(newlyAddedComment); CurrentPostFeed.Comments.Add(newlyAddedComment); CurrentPostFeed.NoOfComments = CurrentPostFeed.Comments.Count; RaisePropertyChanged(nameof(CurrentPostFeed)); } else { UserDialogs.Instance.Alert(AppStrings.LoadingErrorPostFeed, "Error", "Ok"); } }); _eventAggregator.GetEvent <DeletePostFeedToHubResultCodeEventModel>().Subscribe((message) => { DeletingMessage = ""; IsShowPostOptions = false; if (message.HttpStatusCode != HttpStatusCode.OK) { UserDialogs.Instance.Alert(AppStrings.DeletingPostNotSuccessful, "Error", "Ok"); } }); if (PassingParameters != null && PassingParameters.ContainsKey("SelectedPost")) { CurrentPostFeed = (PostFeed)PassingParameters["SelectedPost"]; if (!string.IsNullOrEmpty(CurrentPostFeed.ContentURL)) { HasPostedImage = true; } CurrentContact = (Contact)PassingParameters["CurrentUser"]; } if (PassingParameters != null && PassingParameters.ContainsKey("SupportersAvatars")) { SupportersAvatars = PassingParameters["SupportersAvatars"] as List <string>; } if (IsInternetConnected) { _eventAggregator.GetEvent <LogonPostFeedToHubEventModel>().Publish(new PostFeedMessage { CurrentUser = AppUnityContainer.Instance.Resolve <IServiceMapper>().Instance.Map <Contract.ContactK>(CurrentContact) }); } IsWritePostEnabled = true; IsBusy = false; DeletingMessage = ""; }