BasePrimitive
Represents the base class for all primitive elements in the Telerik WinControls framework.
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, float, SizeF) method.
All primitive classes should inherit from BasePrimitive and override the PaintPrimitive method to provide their specific rendering logic.
Definition
Namespace:Telerik.WinControls.Primitives
Assembly:Telerik.WinControls.dll
Syntax:
[TypeConverter(typeof(ExpandableObjectConverter))]
public class BasePrimitive : VisualElement, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, IPrimitive
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementBasePrimitive...
Derived Classes:
Implements:
Inherited Members
Constructors
public BasePrimitive()
Fields
public const string BoxCategory = "Box"
Properties
Gets a value indicating whether the primitive has visual content to render.
[Browsable(false)]
public virtual bool IsEmpty { get; }
true if the primitive has no content and should not be painted; otherwise, false.
The default implementation returns false, indicating the primitive has content.
This property is used for optimization purposes to avoid unnecessary painting operations when a primitive has no visual content to display.
Methods
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:
Paints the element's background and calls the base implementation to paint child elements.
When overridden in a derived class, performs the actual painting of the primitive.
public virtual void PaintPrimitive(IGraphics graphics, float angle, SizeF scale)
The IGraphics object used for painting operations.
anglefloatThe rotation angle in degrees to apply during painting.
scaleSizeFThe scaling factor to apply during painting.
Implements:
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.