Exemplo n.º 1
0
        internal RadSize OnCellsPanelMeasure(RadSize newAvailableSize)
        {
            newAvailableSize       = GridModel.DoubleArithmetics.Ceiling(newAvailableSize);
            this.lastAvailableSize = newAvailableSize.ToSize();
            var size = this.model.MeasureCells(newAvailableSize);

            return(size);
        }
        internal RadSize MeasureFooter(RadSize availableSize)
        {
            if (this.displayFooter)
            {
                this.footerControl.Measure(availableSize.ToSize());

                return(new RadSize(availableSize.Width, this.footerControl.DesiredSize.Height));
            }

            return(RadSize.Empty);
        }
        internal RadSize MeasureFooter(RadSize availableSize)
        {
            if (this.displayFooter)
            {
                this.footerControl.Measure(availableSize.ToSize());

                if (this.Owner.Orientation == Orientation.Horizontal)
                {
                    return(new RadSize(this.footerControl.DesiredSize.Width, availableSize.Height));
                }

                return(new RadSize(availableSize.Width, this.footerControl.DesiredSize.Height));
            }

            return(RadSize.Empty);
        }
Exemplo n.º 4
0
        internal RadSize MeasureEmptyContent(RadSize availableSize, bool displayEmptyContent)
        {
            RadSize measuredSize = RadSize.Empty;

            if (this.emptyContentControl != null)
            {
                if (displayEmptyContent)
                {
                    this.emptyContentControl.Visibility = Visibility.Visible;

                    this.emptyContentControl.Measure(availableSize.ToSize());
                    var width = double.IsInfinity(availableSize.Width) ? this.emptyContentControl.Width : Math.Max(availableSize.Width, this.emptyContentControl.DesiredSize.Width);

                    if (double.IsNaN(width))
                    {
                        width = 0;
                    }

                    var height = 0d;
                    if (double.IsInfinity(availableSize.Height))
                    {
                        height = this.emptyContentControl.DesiredSize.Height;
                    }
                    else
                    {
                        height = Math.Max(availableSize.Height, this.emptyContentControl.DesiredSize.Height);
                    }

                    if (double.IsNaN(height))
                    {
                        height = 0;
                    }

                    measuredSize = new RadSize(width, height);
                }
                else
                {
                    this.emptyContentControl.Visibility = Visibility.Collapsed;
                }
            }

            return(measuredSize);
        }