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; } }
/// <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; } }