예제 #1
0
        internal virtual void Collapse(LineDecorationModel element)
        {
            // TODO: pass only the UI representation rather than the model
            UIElement container = element.Container as UIElement;

            if (container != null)
            {
                container.Visibility = Visibility.Collapsed;
            }
        }
예제 #2
0
        internal virtual void MakeVisible(LineDecorationModel element)
        {
            // TODO: pass only the UI representation rather than the model
            UIElement container = element.Container as UIElement;

            if (container != null)
            {
                container.ClearValue(UIElement.VisibilityProperty);
            }
        }
예제 #3
0
        internal override void ApplyLineDecoratorProperties(LineDecorationModel lineDecorator, DecorationType decorationType)
        {
            var border = lineDecorator.Container as Border;

            if (border == null)
            {
                return;
            }

            switch (decorationType)
            {
            case DecorationType.Row:
                var brush = this.GetRowFill(lineDecorator.ItemInfo);
                if (brush != null)
                {
                    border.Background = brush;
                }
                else
                {
                    border.ClearValue(Border.BackgroundProperty);
                }

                bool horizontal = this.HasHorizontalLine(lineDecorator.ItemInfo);
                bool last       = this.IsLastLine(lineDecorator.ItemInfo);

                if (horizontal || last)
                {
                    border.BorderBrush = this.Owner.GridLinesBrush;
                    double topThickness    = (horizontal && lineDecorator.ItemInfo.LayoutInfo.Line > 0) ? this.Owner.GridLinesThickness : 0;
                    double bottomThickness = last ? this.Owner.GridLinesThickness : 0;
                    border.BorderThickness = new Thickness(0, topThickness, 0, bottomThickness);
                }
                else
                {
                    border.BorderThickness = new Thickness(0);
                }
                Canvas.SetZIndex(border, ZIndexConstants.HorizontalGridLineBaseZIndex);
                break;

            case DecorationType.Column:
                border.BorderBrush     = this.Owner.GridLinesBrush;
                border.BorderThickness = new Thickness(this.Owner.GridLinesThickness, 0, 0, 0);
                Canvas.SetZIndex(border, ZIndexConstants.VerticalGridLineBaseZIndex + lineDecorator.ItemInfo.LayoutInfo.Line);
                break;
            }
        }
예제 #4
0
        internal override RadRect ArrangeLineDecorator(LineDecorationModel decorator, RadRect radRect)
        {
            var border = decorator.Container as Border;

            if (border == null)
            {
                return(radRect);
            }

            var arrangeRect = new RadRect(radRect.X, radRect.Y, radRect.Width - radRect.X, radRect.Height - radRect.Y);

            if (decorator.ItemInfo.Slot == this.Owner.Model.RowPool.Layout.VisibleLineCount - 1 || decorator.ItemInfo.Slot == this.Owner.FrozenColumnCount - 1)
            {
                // Render the last line outside the last row layout slot.
                arrangeRect.Height += this.Owner.GridLinesThickness;
            }

            Canvas.SetLeft(border, arrangeRect.X);
            Canvas.SetTop(border, arrangeRect.Y);
            border.Arrange(arrangeRect.ToRect());

            return(arrangeRect);
        }
예제 #5
0
 internal abstract RadRect ArrangeLineDecorator(LineDecorationModel decorator, RadRect radRect);
예제 #6
0
 internal abstract void ApplyLineDecoratorProperties(LineDecorationModel lineDecorator, DecorationType decoratorElementType);