コード例 #1
0
        protected override Size ArrangeOverride(Size finalSize)
        {
            UIElement first = this.NonCollapsedChildren.FirstOrDefault();

            if (first != null)
            {
                switch (this.ArrangeMode)
                {
                case ArrangeMode.Nomal:
                    this.ArrangeCore();
                    break;

                case ArrangeMode.Lazy:
                    this._buffer.ReSet(null);
                    break;

                case ArrangeMode.LazyOneTime:
                    if (this._isMeasureArrangedFirstFlag)
                    {
                        this.ArrangeCore();
                    }
                    else
                    {
                        this._buffer.ReSet(null);
                    }
                    break;
                }
            }

            //处理特殊项
            if (!this._isAnchoredItemInit &&
                this.AnchoredItem != null)
            {
                this._isAnchoredItemInit = true;
                this.AddVisualChild(this.AnchoredItem);
            }

            if (this.AnchoredItem != null)
            {
                this.AnchoredItem.Measure(this._eachSize);
                this.AnchoredItem.Arrange(new Rect(new Point((this._columns - 1) * this._eachSize.Width, (this._rows - 1) * this._eachSize.Height), this._eachSize));
            }

            //线条
            if (this.ShowGridLines &&
                this._controlLinesRenderer == null)
            {
                _controlLinesRenderer = new ControlLinesRenderer(this);
                this.AddVisualChild(_controlLinesRenderer);
            }
            if (this.ShowGridLines)
            {
                _controlLinesRenderer.UpdateRenderBounds(finalSize, this._rows, this._columns, this._currentPageCount);
            }

            return(finalSize);
        }
コード例 #2
0
        protected override Size ArrangeOverride(Size arrangeSize)
        {
            var size = base.ArrangeOverride(arrangeSize);

            if (this.ShowGridLines &&
                this._controlLinesRenderer == null)
            {
                _controlLinesRenderer = new ControlLinesRenderer(this);
                this.AddVisualChild(_controlLinesRenderer);
            }

            if (this.ShowGridLines)
            {
                _controlLinesRenderer.UpdateRenderBounds(arrangeSize, this.Rows, this.Columns);
            }

            return(size);
        }