コード例 #1
0
ファイル: ViewLayoutPopupPage.cs プロジェクト: yp25/Krypton
        /// <summary>
        /// Perform a layout of the elements.
        /// </summary>
        /// <param name="context">Layout context.</param>
        public override void Layout(ViewLayoutContext context)
        {
            Debug.Assert(context != null);

            // We take on all the available display area
            ClientRectangle = context.DisplayRectangle;

            // Are we allowed to layout child controls?
            if (!context.ViewManager.DoNotLayoutControls)
            {
                // Are we allowed to actually layout the pages?
                if (_navigator.InternalCanLayout)
                {
                    // Update position of page if not already in correct position
                    if ((_page.Location != Point.Empty) ||
                        (_page.Width != ClientWidth) ||
                        (_page.Height != ClientHeight))
                    {
                        _page.SetBounds(0, 0, ClientWidth, ClientHeight);
                    }

                    // Update position of child panel if not already in correct position
                    if ((_navigator.ChildPanel.Location != ClientLocation) ||
                        (_navigator.ChildPanel.Width != ClientWidth) ||
                        (_navigator.ChildPanel.Height != ClientHeight))
                    {
                        // Position the child panel for showing page
                        _navigator.ChildPanel.SetBounds(ClientLocation.X,
                                                        ClientLocation.Y,
                                                        ClientWidth,
                                                        ClientHeight);
                    }
                }
            }
        }