internal void UpdateLayouts() { var displayedPage = GetDisplayedPage(_mainPage); if (displayedPage == null) { return; } var containerArea = GetContainerArea(_mainPage); if (containerArea.Width <= 0) { return; } IsSpanned = HingeService.IsSpanned; IsPortrait = !HingeService.IsLandscape; IsLandscape = HingeService.IsLandscape; ContainerArea = containerArea; Hinge = HingeService.GetHinge(); if (!HingeService.IsLandscape) { if (HingeService.IsSpanned) { var paneWidth = (containerArea.Width - Hinge.Width) / 2; Pane1 = new Rectangle(0, 0, paneWidth, containerArea.Height); Pane2 = new Rectangle(paneWidth + Hinge.Width, 0, paneWidth, Pane1.Height); } else { Pane1 = new Rectangle(0, 0, containerArea.Width, containerArea.Height); Pane2 = Rectangle.Zero; } } else { var displayedScreenAbsCoordinates = LayoutService.GetLocationOnScreen(displayedPage) ?? Point.Zero; if (HingeService.IsSpanned) { var screenSize = Device.info.ScaledScreenSize; var topStuffHeight = displayedScreenAbsCoordinates.Y; var bottomStuffHeight = screenSize.Height - topStuffHeight - containerArea.Height; var paneWidth = containerArea.Width; var leftPaneHeight = Hinge.Y - topStuffHeight; var rightPaneHeight = screenSize.Height - topStuffHeight - leftPaneHeight - bottomStuffHeight - Hinge.Height; Pane1 = new Rectangle(0, 0, paneWidth, leftPaneHeight); Pane2 = new Rectangle(0, Hinge.Y + Hinge.Height - topStuffHeight, paneWidth, rightPaneHeight); } else { Pane1 = new Rectangle(0, 0, containerArea.Width, containerArea.Height); Pane2 = Rectangle.Zero; } } }