Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public override void WillRotate(UIInterfaceOrientation toInterfaceOrientation, double duration)
        {
            base.WillRotate(toInterfaceOrientation, duration);

            if (!InterfaceOrientation.Equals(toInterfaceOrientation))
            {
                UpdateLayout(toInterfaceOrientation);
            }
        }
Exemplo n.º 3
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            //Clear and reload our map placemarks
            mapView.ClearPlacemarks();

            List <MKPlacemark> placemarks = new List <MKPlacemark>();

            if (assignmentViewModel.ActiveAssignment != null)
            {
                var assignment = assignmentViewModel.ActiveAssignment;
                if (assignment.Latitude != 0 && assignment.Longitude != 0)
                {
                    placemarks.Add(assignment.ToPlacemark());
                }
            }

            foreach (var assignment in assignmentViewModel.Assignments)
            {
                if (assignment.Latitude != 0 && assignment.Longitude != 0)
                {
                    placemarks.Add(assignment.ToPlacemark());
                }
            }

            if (placemarks.Count > 0)
            {
                mapView.AddPlacemarks(placemarks.ToArray());
            }

            //Show/hide the active assignment
            LoadActiveAssignment();

            //Apply the current orientation
            if (InterfaceOrientation.IsLandscape())
            {
                contact.Alpha     =
                    address.Alpha = 1;
            }
            else
            {
                contact.Alpha     =
                    address.Alpha = 0;
            }
        }
Exemplo n.º 4
0
        /// <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);
        }
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            //Load our assignments
            ReloadAssignments();
            //Apply the current orientation
            if (InterfaceOrientation.IsLandscape())
            {
                contact.Alpha     =
                    address.Alpha = 1;
            }
            else
            {
                contact.Alpha     =
                    address.Alpha = 0;
            }
        }