BorderPrimitive
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
public BorderPrimitive()
Fields
public static readonly RadProperty BorderBoxStyleProperty
public static readonly RadProperty BorderDashPatternProperty
public static readonly RadProperty BorderDashStyleProperty
public static readonly RadProperty BorderDrawModeProperty
public static readonly RadProperty BottomColorProperty
public static readonly RadProperty BottomShadowColorProperty
public static readonly RadProperty BottomWidthProperty
public static RadProperty ForeColor2Property
public static RadProperty ForeColor3Property
public static RadProperty ForeColor4Property
public static RadProperty GradientAngleProperty
public static RadProperty GradientStyleProperty
public static RadProperty InnerColor2Property
public static RadProperty InnerColor3Property
public static RadProperty InnerColor4Property
public static RadProperty InnerColorProperty
public static readonly RadProperty LeftColorProperty
public static readonly RadProperty LeftShadowColorProperty
public static readonly RadProperty LeftWidthProperty
public static readonly RadProperty PaintUsingParentShapeProperty
public static readonly RadProperty RightColorProperty
public static readonly RadProperty RightShadowColorProperty
public static readonly RadProperty RightWidthProperty
public static readonly RadProperty TopColorProperty
public static readonly RadProperty TopShadowColorProperty
public static readonly RadProperty TopWidthProperty
public static readonly RadProperty WidthProperty
Properties
Specifies the pattern of dashed lines drawn when the BorderDashStyle is custom.
public float[] BorderDashPattern { get; set; }
Implements:
Specifies the style of dashed lines drawn with a border.
public DashStyle BorderDashStyle { get; set; }
Implements:
public BorderDrawModes BorderDrawMode { get; set; }
Implements:
Retrieves size of the combined bottom, right, upper, and left border.
[Browsable(false)]
public SizeF BorderSize { get; }
Implements:
Gets and sets the bottom border color. This applies only if FourBorders is chosen for BoxStyle property, and affects only the bottom border.
[TypeConverter(typeof(RadColorEditorConverter))]
public Color BottomColor { get; set; }
Implements:
Gets and sets the bottom shadow color. This option applies only if fourBorders is chosen, and affects only the bottom border.
[TypeConverter(typeof(RadColorEditorConverter))]
public Color BottomShadowColor { get; set; }
Implements:
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.
public float BottomWidth { get; set; }
Implements:
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.
public BorderBoxStyle BoxStyle { get; set; }
Implements:
Gets or sets a value indicating the way element will fill its available size when parent element is calculating element size and location.
public override RadFitToSizeMode FitToSizeMode { get; set; }
Overrides:
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.
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color ForeColor2 { get; set; }
Implements:
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.
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color ForeColor3 { get; set; }
Implements:
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.
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color ForeColor4 { get; set; }
Implements:
Gets or sets gradient angle for linear gradient measured in degrees.
public float GradientAngle { get; set; }
Implements:
Gets or sets gradient style. Possible styles are solid, linear, radial, glass, office glass, gel, and vista.
public GradientStyles GradientStyle { get; set; }
Implements:
Gets the horizontal width of the combined left and right border.
[Browsable(false)]
public float HorizontalWidth { get; }
Implements:
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.
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color InnerColor { get; set; }
Implements:
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.
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color InnerColor2 { get; set; }
Implements:
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.
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color InnerColor3 { get; set; }
Implements:
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.
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color InnerColor4 { get; set; }
Implements:
Gets and sets the left border color. This applies only if FourBorders is chosen for BoxStyle property, and affects only the left border.
[TypeConverter(typeof(RadColorEditorConverter))]
public Color LeftColor { get; set; }
Implements:
Gets and sets the left shadow color. This option applies only if fourBorders is chosen, and affects only the left border.
[TypeConverter(typeof(RadColorEditorConverter))]
public Color LeftShadowColor { get; set; }
Implements:
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.
public float LeftWidth { get; set; }
Implements:
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.
[Browsable(false)]
public SizeF Offset { get; }
Implements:
Specifies whether the BorderPrimitive should draw the GraphicsPath defined by its Parent.Shape. If false, it will draw its bounding rectangle.
public bool PaintUsingParentShape { get; set; }
Gets and sets the right border color. This applies only if FourBorders is chosen for BoxStyle property, and affects only the right border.
[TypeConverter(typeof(RadColorEditorConverter))]
public Color RightColor { get; set; }
Implements:
Gets and sets the right shadow color. This option applies only if fourBorders is chosen, and affects only the right border.
[TypeConverter(typeof(RadColorEditorConverter))]
public Color RightShadowColor { get; set; }
Implements:
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.
public float RightWidth { get; set; }
Implements:
protected override bool ShouldPaintUsingParentShape { get; }
Overrides:
Gets and sets the top border color. This applies only if FourBorders is chosen for BoxStyle property, and affects only the top border.
[TypeConverter(typeof(RadColorEditorConverter))]
public Color TopColor { get; set; }
Implements:
Gets and sets the top shadow color. This option applies only if fourBorders is chosen, and affects only the top border.
[TypeConverter(typeof(RadColorEditorConverter))]
public Color TopShadowColor { get; set; }
Implements:
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.
public float TopWidth { get; set; }
Implements:
Gets the vertical width of the combined bottom and upper border.
[Browsable(false)]
public float VerticalWidth { get; }
Implements:
Methods
Arranges the RadElement to its final location. The element must call the Arrange method of each of its children.
protected override SizeF ArrangeOverride(SizeF 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:
In this method call to the Arrange method of each child must be made.
Allows inheritors to provide custom default value.
protected override object GetDefaultValue(RadPropertyValue propVal, object baseDefaultValue)
Overrides:
Gets the IFilter instance that may be used to filter the properties, treated as Stylable for this element.
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.
protected override void InitializeFields()
Overrides:
Measures the space required by the RadElement
Used by the layout system.
protected override SizeF MeasureOverride(SizeF 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:
In this method call to the Measure method of each child must be made.
protected override void OnChildrenChanged(RadElement child, ItemsChangeOperation changeOperation)
Overrides:
Notifies for a change in the Parent value.
protected override void OnParentChanged(RadElement previousParent)
The previous parent element (if any)
Overrides:
Called when a property value has changed, allowing for custom response to property changes.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
The property changed event arguments.
Overrides:
Renders the border primitive using the specified graphics context with rotation and scaling support.
public override void PaintPrimitive(IGraphics graphics, float angle, SizeF scale)
The graphics context to use for rendering the border.
anglefloatThe rotation angle in degrees to apply during rendering.
scaleSizeFThe scaling factor to apply during rendering.
Overrides:
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.
Determines whether the property defined by the provided property descriptor should be serialized.
public override bool? ShouldSerializeProperty(PropertyDescriptor property)
bool?
Overrides: