ClassBorderPrimitive
Represents a primitive element that renders borders around other elements with comprehensive styling and customization options.
Definition
Namespace:Telerik.WinControls.Primitives
Assembly:Telerik.WinControls.dll
Syntax:
public class BorderPrimitive : BasePrimitive, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, IPrimitive, IBorderElement, IBoxStyle, IBoxElement, IPrimitiveElement, IShapedElement
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementBasePrimitiveBorderPrimitive
Derived Classes:
Implements:
Inherited Members
Constructors
BorderPrimitive()
Declaration
public BorderPrimitive()
Fields
BorderBoxStyleProperty
Declaration
public static readonly RadProperty BorderBoxStyleProperty
Field Value
BorderDashPatternProperty
Declaration
public static readonly RadProperty BorderDashPatternProperty
Field Value
BorderDashStyleProperty
Declaration
public static readonly RadProperty BorderDashStyleProperty
Field Value
BorderDrawModeProperty
Declaration
public static readonly RadProperty BorderDrawModeProperty
Field Value
BottomColorProperty
Declaration
public static readonly RadProperty BottomColorProperty
Field Value
BottomShadowColorProperty
Declaration
public static readonly RadProperty BottomShadowColorProperty
Field Value
BottomWidthProperty
Declaration
public static readonly RadProperty BottomWidthProperty
Field Value
GradientAngleProperty
Declaration
public static RadProperty GradientAngleProperty
Field Value
GradientStyleProperty
Declaration
public static RadProperty GradientStyleProperty
Field Value
LeftColorProperty
Declaration
public static readonly RadProperty LeftColorProperty
Field Value
LeftShadowColorProperty
Declaration
public static readonly RadProperty LeftShadowColorProperty
Field Value
LeftWidthProperty
Declaration
public static readonly RadProperty LeftWidthProperty
Field Value
PaintUsingParentShapeProperty
Declaration
public static readonly RadProperty PaintUsingParentShapeProperty
Field Value
RightColorProperty
Declaration
public static readonly RadProperty RightColorProperty
Field Value
RightShadowColorProperty
Declaration
public static readonly RadProperty RightShadowColorProperty
Field Value
RightWidthProperty
Declaration
public static readonly RadProperty RightWidthProperty
Field Value
TopColorProperty
Declaration
public static readonly RadProperty TopColorProperty
Field Value
TopShadowColorProperty
Declaration
public static readonly RadProperty TopShadowColorProperty
Field Value
TopWidthProperty
Declaration
public static readonly RadProperty TopWidthProperty
Field Value
WidthProperty
Declaration
public static readonly RadProperty WidthProperty
Field Value
Properties
BorderDashPattern
Specifies the pattern of dashed lines drawn when the BorderDashStyle is custom.
Declaration
public float[] BorderDashPattern { get; set; }
Property Value
float[]
Implements
BorderDashStyle
Specifies the style of dashed lines drawn with a border.
Declaration
public DashStyle BorderDashStyle { get; set; }
Property Value
Implements
BorderDrawMode
Declaration
public BorderDrawModes BorderDrawMode { get; set; }
Property Value
Implements
BorderSize
Retrieves size of the combined bottom, right, upper, and left border.
Declaration
[Browsable(false)]
public SizeF BorderSize { get; }
Property Value
Implements
BottomColor
Gets and sets the bottom border color. This applies only if FourBorders is chosen for BoxStyle property, and affects only the bottom border.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public Color BottomColor { get; set; }
Property Value
Implements
BottomShadowColor
Gets and sets the bottom shadow color. This option applies only if fourBorders is chosen, and affects only the bottom border.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public Color BottomShadowColor { get; set; }
Property Value
Implements
BottomWidth
Gets or sets a float value width. This property has effect only if FourBorders style is used in BoxStyle property, and affects only the bottom border.
Declaration
public float BottomWidth { get; set; }
Property Value
Implements
BoxStyle
Gets or sets the Border style. The two possible values are SingleBorder and FourBorder. In the single border case, all four sides share the same appearance although the entire border may have gradient. In four border case, each of the four sides may differ in appearance. For example, the left border may have different color, shadowcolor, and width from the rest. When SingleBorder is chosen, you should use the general properties such as width and color, and respectively, when the FourBorder style is chosen you should use properties prefixed with the corresponding side, for example, LeftColor, LeftWidth for the left side.
Declaration
public BorderBoxStyle BoxStyle { get; set; }
Property Value
Implements
FitToSizeMode
Gets or sets a value indicating the way element will fill its available size when parent element is calculating element size and location.
Declaration
public override RadFitToSizeMode FitToSizeMode { get; set; }
Property Value
Overrides
ForeColor2
Gets or sets color used by radial, glass, office glass, gel, and vista gradients. This is one of the colors that are used in the gradient effect.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color ForeColor2 { get; set; }
Property Value
Implements
ForeColor3
Gets or sets color used by radial, glass, office glass, and vista gradients. This is one of the colors that are used in the gradient effect.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color ForeColor3 { get; set; }
Property Value
Implements
ForeColor4
Gets or sets color used by radial, glass, office glass, and vista gradients. This is one of the colors that are used in the gradient effect.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color ForeColor4 { get; set; }
Property Value
Implements
GradientAngle
Gets or sets gradient angle for linear gradient measured in degrees.
Declaration
public float GradientAngle { get; set; }
Property Value
Implements
GradientStyle
Gets or sets gradient style. Possible styles are solid, linear, radial, glass, office glass, gel, and vista.
Declaration
public GradientStyles GradientStyle { get; set; }
Property Value
Implements
HorizontalWidth
Gets the horizontal width of the combined left and right border.
Declaration
[Browsable(false)]
public float HorizontalWidth { get; }
Property Value
Implements
InnerColor
Gets or sets color used by radial, glass, office glass, gel, and vista gradients. This is one of the colors that are used in the gradient effect.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color InnerColor { get; set; }
Property Value
Implements
InnerColor2
Gets or sets color used by radial, glass, office glass, gel, and vista gradients. This is one of the colors that are used in the gradient effect.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color InnerColor2 { get; set; }
Property Value
Implements
InnerColor3
Gets or sets color used by radial, glass, office glass, gel, and vista gradients. This is one of the colors that are used in the gradient effect.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color InnerColor3 { get; set; }
Property Value
Implements
InnerColor4
Gets or sets color used by radial, glass, office glass, gel, and vista gradients. This is one of the colors that are used in the gradient effect.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color InnerColor4 { get; set; }
Property Value
Implements
LeftColor
Gets and sets the left border color. This applies only if FourBorders is chosen for BoxStyle property, and affects only the left border.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public Color LeftColor { get; set; }
Property Value
Implements
LeftShadowColor
Gets and sets the left shadow color. This option applies only if fourBorders is chosen, and affects only the left border.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public Color LeftShadowColor { get; set; }
Property Value
Implements
LeftWidth
Gets or sets a float value width of the left border. This property has effect only if FourBorders style is used in BoxStyle property and affects only the width of the left border.
Offset
Gets the border offset of the primitive. It effectively retrieves the upper-left corner inside the primitive border. It takes into consideration the BoxStyle property and possible different widths of the left and the upper side.
Declaration
[Browsable(false)]
public SizeF Offset { get; }
Property Value
Implements
PaintUsingParentShape
Specifies whether the BorderPrimitive should draw the GraphicsPath defined by its Parent.Shape. If false, it will draw its bounding rectangle.
RightColor
Gets and sets the right border color. This applies only if FourBorders is chosen for BoxStyle property, and affects only the right border.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public Color RightColor { get; set; }
Property Value
Implements
RightShadowColor
Gets and sets the right shadow color. This option applies only if fourBorders is chosen, and affects only the right border.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public Color RightShadowColor { get; set; }
Property Value
Implements
RightWidth
Gets or sets a float value width of the right border. This property has effect only if FourBorders style is used in BoxStyle property, and affects only the right border.
ShouldPaintUsingParentShape
Declaration
protected override bool ShouldPaintUsingParentShape { get; }
Property Value
Overrides
TopColor
Gets and sets the top border color. This applies only if FourBorders is chosen for BoxStyle property, and affects only the top border.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public Color TopColor { get; set; }
Property Value
Implements
TopShadowColor
Gets and sets the top shadow color. This option applies only if fourBorders is chosen, and affects only the top border.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public Color TopShadowColor { get; set; }
Property Value
Implements
TopWidth
Gets or sets a float value width of the top border . This property has effect only if FourBorders style is used in BoxStyle property, and affects only the top border.
VerticalWidth
Gets the vertical width of the combined bottom and upper border.
Declaration
[Browsable(false)]
public float VerticalWidth { get; }
Property Value
Implements
Width
Gets or sets float value indicating the width of the border measured in pixels. It is only used when SingleBorder style is chosen for the BoxStyle property which effectively means that all four borders share the same width.
Methods
ArrangeOverride(SizeF)
Arranges the RadElement to its final location. The element must call the Arrange method of each of its children.
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
finalSize
The size that is available for element.
Returns
The rectangle occupied by the element. Usually finalSize. Should you return different size, the Layout system will restart measuring and rearranging the items. That could lead to infinite recursion.
Overrides
Remarks
In this method call to the Arrange method of each child must be made.
GetBorderThickness()
Gets the border thickness.
GetDefaultValue(RadPropertyValue, object)
Allows inheritors to provide custom default value.
Declaration
protected override object GetDefaultValue(RadPropertyValue propVal, object baseDefaultValue)
Parameters
propVal
baseDefaultValue
Returns
Overrides
GetStylablePropertiesFilter()
Gets the IFilter instance that may be used to filter the properties, treated as Stylable for this element.
Declaration
public override Filter GetStylablePropertiesFilter()
Returns
Overrides
InitializeFields()
Initializes member fields to their default values. This method is called prior the CreateChildItems one and allows for initialization of members on which child elements depend.
Declaration
protected override void InitializeFields()
Overrides
MeasureOverride(SizeF)
Measures the space required by the RadElement
Used by the layout system.
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
availableSize
The size that is available to the RadElement. The available size can be infinity (to take the full size of the element)
Returns
The minimum size required by the element to be completely visible. Cannot be infinity.
Overrides
Remarks
In this method call to the Measure method of each child must be made.
OnChildrenChanged(RadElement, ItemsChangeOperation)
Declaration
protected override void OnChildrenChanged(RadElement child, ItemsChangeOperation changeOperation)
Parameters
child
changeOperation
Overrides
OnParentChanged(RadElement)
Notifies for a change in the Parent value.
Declaration
protected override void OnParentChanged(RadElement previousParent)
Parameters
previousParent
The previous parent element (if any)
Overrides
OnPropertyChanged(RadPropertyChangedEventArgs)
Called when a property value has changed, allowing for custom response to property changes.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
e
The property changed event arguments.
Overrides
PaintPrimitive(IGraphics, float, SizeF)
Renders the border primitive using the specified graphics context with rotation and scaling support.
Declaration
public override void PaintPrimitive(IGraphics graphics, float angle, SizeF scale)
Parameters
graphics
The graphics context to use for rendering the border.
angle
The rotation angle in degrees to apply during rendering.
scale
The scaling factor to apply during rendering.
Overrides
Remarks
This method delegates the actual border painting to the internal border implementation, which handles the complex rendering logic for different border styles, shapes, and effects. The rendering is optimized for performance and supports advanced features like anti-aliasing and gradient effects.
ShouldSerializeProperty(PropertyDescriptor)
Determines whether the property defined by the provided property descriptor should be serialized.
Declaration
public override bool? ShouldSerializeProperty(PropertyDescriptor property)
Parameters
property
Returns
bool?
Overrides