public override void ViewDidLoad() { base.ViewDidLoad(); TextFieldCode.ShouldReturn += (textField) => { TextFieldCode.ResignFirstResponder(); ButtonEnterCode_TouchUpInside(null); return(true); }; ButtonEnterCode.Layer.CornerRadius = ButtonCancel.Layer.CornerRadius = 5; TextFieldCode.Layer.BorderColor = EvolveQuest.Shared.Helpers.Color.Blue.ToCGColor(); // Keyboard popup NSNotificationCenter.DefaultCenter.AddObserver (UIKeyboard.DidShowNotification, KeyBoardUpNotification); // Keyboard Down NSNotificationCenter.DefaultCenter.AddObserver (UIKeyboard.WillHideNotification, KeyBoardDownNotification); }
partial void ButtonEnterCode_TouchUpInside(UIButton sender) { if (ViewModel.QuestComplete) { DismissViewControllerAsync(true); return; } TextFieldCode.ResignFirstResponder(); ViewModel.ExtraTaskText = TextFieldCode.Text.Trim(); ViewModel.CheckCode(ViewModel.ExtraTaskText); if (ViewModel.QuestComplete) { ButtonCancel.Hidden = TextFieldCode.Hidden = true; ButtonEnterCode.SetTitle("Continue", UIControlState.Normal); LabelHint.Text = "Are you ready to continue with the next quest, thrill-seeker?"; LabelAwesome.Text = "That's it!"; LabelCongrats.Text = "You entered the correct code."; Settings.QuestDone = true; } }
partial void ButtonCancel_TouchUpInside(UIButton sender) { TextFieldCode.ResignFirstResponder(); DismissViewControllerAsync(true); }