コード例 #1
0
        private void PinTextField_EditingChanged(object sender, EventArgs e)
        {
            SetLabelText();

            if (BasePinTextField.Text.Length >= 4)
            {
                if (BasePinTextField.Text == _authService.PIN)
                {
                    Debug.WriteLine("BW Log, Start Dismiss PIN controller.");
                    _appSettingsService.Locked = false;
                    BasePinTextField.ResignFirstResponder();
                    Success();
                }
                else
                {
                    // TODO: keep track of invalid attempts and logout?

                    var alert = Dialogs.CreateAlert(null, AppResources.InvalidPIN, AppResources.Ok, (a) =>
                    {
                        BasePinTextField.Text = string.Empty;
                        SetLabelText();
                        BasePinTextField.BecomeFirstResponder();
                    });
                    PresentViewController(alert, true, null);
                }
            }
        }
コード例 #2
0
 public override void ViewDidAppear(bool animated)
 {
     base.ViewDidAppear(animated);
     BasePinTextField.BecomeFirstResponder();
 }