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; } }
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); } }
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; } }
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); }
internal abstract RadRect ArrangeLineDecorator(LineDecorationModel decorator, RadRect radRect);
internal abstract void ApplyLineDecoratorProperties(LineDecorationModel lineDecorator, DecorationType decoratorElementType);