public override void ViewDidLoad() { base.ViewDidLoad(); DisplayNameText.Text = StringWithEmojiConverter.ConvertEmojiFromServer(SL.Profile.UserName);//need to anderstand difference from NameText CityText.Text = SL.Profile.City ?? ""; NameOfCity = SL.Profile.City ?? ""; NameText.Text = SL.Profile.UserName; CityText.EditingChanged += (s, e) => { CityText.Text = CheckText(CityText.Text); }; EmailText.EditingDidEnd += (s, e) => { var profile = SL.Profile; profile.EmailAddress = EmailText.Text; SL.Manager.SaveProfileAsync(profile); SL.Profile = profile; }; NameText.ShouldReturn = delegate { NameText.EndEditing(true); return(true); }; DisplayNameText.ShouldReturn = delegate { DisplayNameText.EndEditing(true); return(true); }; CityText.ShouldReturn = delegate { CityText.EndEditing(true); return(true); }; EmailText.ShouldReturn = delegate { EmailText.EndEditing(true); return(true); }; var tap = new UITapGestureRecognizer(() => { foreach (var view in View.Subviews[0].Subviews[0].Subviews) { if (view is UITextView text) { text.ResignFirstResponder(); } if (view is UITextField text1) { text1.ResignFirstResponder(); } } }); View.AddGestureRecognizer(tap); EmailText.Text = SL.Profile.EmailAddress; var version = NSBundle.MainBundle.InfoDictionary["CFBundleVersion"];//NSBundle.MainBundle.InfoDictionary["CFBundleShortVersionString"]; VersionNumber.Text = $"v{version.Description}"; #region v2 //swFromElectricAdvinture.On = SL.AppSettings.GetValueOrDefault("FromElectricAdvintureEnabled", false); //swFromElectricAdvinture.ValueChanged += SwFromElectricAdvinture_ValueChanged; //Need remove to v.2 Name_View.TranslatesAutoresizingMaskIntoConstraints = false; Name_Divider.Hidden = true; Name_View.RemoveConstraint(Name_View_Aspect); Name_View.AddConstraint(NSLayoutConstraint.Create(Name_View, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 0, 0)); Name_View.UpdateConstraints(); #endregion swComments.On = SL.AppSettings.GetValueOrDefault("CommentsEnabled", false); swComments.ValueChanged += SwComments_ValueChanged; swLikes.On = SL.AppSettings.GetValueOrDefault("LikesEnabled", false); swLikes.ValueChanged += SwLikes_ValueChanged; swDiscoverTeams.On = SL.AppSettings.GetValueOrDefault("DiscoverTeamsEnabled", false); swDiscoverTeams.ValueChanged += SwDiscoverTeams_ValueChanged; swHideSocialNetworks.On = SL.AppSettings.GetValueOrDefault("HideSocialNetworksEnabled", false); swHideSocialNetworks.ValueChanged += SwHideSocialNetworks_ValueChanged; #region v1 var notificationStatus = SL.AppSettings.GetValueOrDefault("NotificationStatus", string.Empty); swNotifications.On = notificationStatus.Equals(Enums.NotififcationStatus.Enabled.ToString()) ? true : false; swNotifications.ValueChanged += SwNotifications_ValueChanged; //SetupNotificationSwitch(); ViewHideBlockDiscover.AddConstraint(NSLayoutConstraint.Create(ViewHideBlockDiscover, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1, 0)); ViewHideBlockNotification.AddConstraint(NSLayoutConstraint.Create(ViewHideBlockNotification, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1, 0)); View.UpdateConstraints(); #endregion }