コード例 #1
0
        public virtual Rectangle GetClientRectangleFromContentElement(RadPageViewContentAreaElement contentArea)
        {
            Rectangle contentBounds = contentArea.ControlBoundingRectangle;
            Padding   padding       = contentArea.Padding;
            Padding   border        = contentArea.GetBorderThickness(false);

            contentBounds.X      += padding.Left + border.Left;
            contentBounds.Y      += padding.Top + border.Top;
            contentBounds.Width  -= padding.Horizontal + border.Horizontal;
            contentBounds.Height -= padding.Vertical + border.Vertical;

            return(contentBounds);
        }
コード例 #2
0
        protected override void CreateChildElements()
        {
            this.contentArea       = new RadPageViewContentAreaElement();
            this.contentArea.Owner = this;
            this.Children.Add(this.contentArea);

            this.header            = new RadPageViewLabelElement();
            this.header.Class      = "PageViewHeader";
            this.header.Visibility = ElementVisibility.Collapsed;
            this.Children.Add(this.header);

            this.footer            = new RadPageViewLabelElement();
            this.footer.Class      = "PageViewFooter";
            this.footer.Visibility = ElementVisibility.Collapsed;
            this.Children.Add(this.footer);
        }
コード例 #3
0
        protected internal override void OnContentBoundsChanged()
        {
            if (this.Owner == null)
            {
                return;
            }

            foreach (RadPageViewPage page in this.Owner.Pages)
            {
                RadPageViewExplorerBarItem    item        = page.Item as RadPageViewExplorerBarItem;
                RadPageViewContentAreaElement contentArea = this.GetContentAreaForItem(item);
                page.Bounds = this.GetClientRectangleFromContentElement(contentArea);
            }

            this.Owner.Update();
        }
コード例 #4
0
        protected override RadPageViewItem CreateItem()
        {
            RadPageViewExplorerBarItem item = new RadPageViewExplorerBarItem();

            if (this.Items.Count == 0)
            {
                item.AssociatedContentAreaElement = this.ContentArea as RadPageViewContentAreaElement;
            }
            else
            {
                RadPageViewContentAreaElement contentElement = new RadPageViewContentAreaElement();
                contentElement.Visibility         = ElementVisibility.Collapsed;
                item.AssociatedContentAreaElement = contentElement;
                contentElement.Owner = this;
            }

            return(item);
        }
コード例 #5
0
        protected override RectangleF ArrangeContent(RectangleF clientRect)
        {
            List <ContentAreaLayoutInfo> layoutInfos    = this.GetContentAreaLayoutInfos(clientRect);
            ExplorerBarLayoutInfo        explLayoutInfo = this.layoutInfo as ExplorerBarLayoutInfo;

            explLayoutInfo.fullLayoutLength = explLayoutInfo.layoutLength;
            foreach (ContentAreaLayoutInfo contentAreaLayoutInfo in layoutInfos)
            {
                RadPageViewExplorerBarItem    item = (contentAreaLayoutInfo.AssociatedItem as RadPageViewExplorerBarItem);
                RadPageViewContentAreaElement contentAreaElement = item.AssociatedContentAreaElement;
                contentAreaElement.Arrange(contentAreaLayoutInfo.ContentAreaRectangle);

                switch (explLayoutInfo.position)
                {
                case StackViewPosition.Top:
                    explLayoutInfo.fullLayoutLength += contentAreaLayoutInfo.ContentAreaRectangle.Height;
                    break;

                case StackViewPosition.Left:
                    explLayoutInfo.fullLayoutLength += contentAreaLayoutInfo.ContentAreaRectangle.Width;
                    break;
                }
            }

            this.OnContentBoundsChanged();

            switch (explLayoutInfo.position)
            {
            case StackViewPosition.Top:
                if (this.Header.Visibility == ElementVisibility.Visible)
                {
                    explLayoutInfo.fullLayoutLength += this.Header.Margin.Bottom;
                }
                if (this.Footer.Visibility == ElementVisibility.Visible)
                {
                    explLayoutInfo.fullLayoutLength += this.Footer.Margin.Top;
                }
                break;
            }
            explLayoutInfo.fullLayoutLength -= explLayoutInfo.expandedItemsCount * explLayoutInfo.itemSpacing;
            return(clientRect);
        }