Example #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            signInButton.SetBackgroundImage(Theme.LoginButton, UIControlState.Normal);

            logo.Image       = Theme.Logo;
            indicator.Hidden = true;

            Label(username, "Username");
            username.TextColor    = Theme.LabelColor;
            username.Background   = Theme.LoginTextField;
            username.ShouldReturn = sender => {
                password.BecomeFirstResponder();
                return(true);
            };

            Label(password, "Password");
            password.TextColor    = Theme.LabelColor;
            password.Background   = Theme.LoginTextField;
            password.ShouldReturn = sender => {
                password.ResignFirstResponder();
                SignIn(signInButton);
                return(true);
            };

            _wasLandscape = InterfaceOrientation.IsPortrait();

            HideSignInForm();
            SwitchOrientation(InterfaceOrientation, false);
        }
        /// <summary>
        /// We override this to show/hide some controls during rotation
        /// </summary>c
        public override void WillRotate(UIInterfaceOrientation toInterfaceOrientation, double duration)
        {
            bool wasPortrait     = InterfaceOrientation.IsPortrait();
            bool willBePortrait  = toInterfaceOrientation.IsPortrait();
            bool wasLandscape    = InterfaceOrientation.IsLandscape();
            bool willBeLandscape = toInterfaceOrientation.IsLandscape();

            if (wasPortrait && willBeLandscape)
            {
                SetContactVisible(true, duration);
            }
            else if (wasLandscape && willBePortrait)
            {
                SetContactVisible(false, duration);
            }

            base.WillRotate(toInterfaceOrientation, duration);
        }