Class BasePrimitive
Represents the base class for all primitive elements in the Telerik WinControls framework.
Inherited Members
Namespace: Telerik.WinControls.Primitives
Assembly: Telerik.WinControls.dll
Syntax
public class BasePrimitive : VisualElement, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, IPrimitive
Remarks
Primitives are RadElement instances that are actually rendered on the screen, such as borders, fills, text, images, and other visual components. They form the building blocks of complex controls.
This base class defines the core painting infrastructure that all primitives must implement through the PaintPrimitive(IGraphics, Single, SizeF) method.
All primitive classes should inherit from BasePrimitive and override the PaintPrimitive method to provide their specific rendering logic.
Constructors
BasePrimitive()
Declaration
public BasePrimitive()
Fields
BoxCategory
Declaration
public const string BoxCategory = "Box"
Field Value
System.String
|
Properties
IsEmpty
Gets a value indicating whether the primitive has visual content to render.
Declaration
public virtual bool IsEmpty { get; }
Property Value
System.Boolean
|
Remarks
This property is used for optimization purposes to avoid unnecessary painting operations when a primitive has no visual content to display.
Methods
InitializeFields()
PaintElement(IGraphics, Single, SizeF)
Declaration
protected override void PaintElement(IGraphics graphics, float angle, SizeF scale)
Parameters
IGraphics
graphics
|
System.Single
angle
|
System.Drawing.SizeF
scale
|
Overrides
PaintPrimitive(IGraphics, Single, SizeF)
When overridden in a derived class, performs the actual painting of the primitive.
Declaration
public virtual void PaintPrimitive(IGraphics graphics, float angle, SizeF scale)
Parameters
IGraphics
graphics
The IGraphics object used for painting operations. |
System.Single
angle
The rotation angle in degrees to apply during painting. |
System.Drawing.SizeF
scale
The scaling factor to apply during painting. |
Implements
Remarks
This is the core method that derived primitive classes must override to implement their specific rendering logic. The base implementation is empty and should be overridden.