ClassRadioPrimitive
Represents a primitive element that renders radio button indicators with circular selection states.
Definition
Namespace:Telerik.WinControls.Primitives
Assembly:Telerik.WinControls.dll
Syntax:
public class RadioPrimitive : FillPrimitive, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, IPrimitive, IFillElement, IPrimitiveElement, IShapedElement
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementBasePrimitiveFillPrimitiveRadioPrimitive
Derived Classes:
Implements:
Inherited Members
Constructors
RadioPrimitive()
Declaration
public RadioPrimitive()
Fields
UseParentShapeProperty
Declaration
public static RadProperty UseParentShapeProperty
Field Value
Properties
UseParentShape
Gets or sets a value indicating whether this primitive should use its parent's shape for rendering.
Declaration
public bool UseParentShape { get; set; }
Property Value
true if the primitive should inherit and use the parent element's shape; otherwise, false.
The default value is true.
Remarks
When enabled, this property allows the radio primitive to adopt the shape defined by its parent element, providing visual consistency in complex control hierarchies. When disabled, the primitive uses its default rectangular rendering approach.
Methods
CreatePath(Rectangle)
Declaration
protected virtual GraphicsPath CreatePath(Rectangle rect)
Parameters
rect
Returns
InitializeFields()
Initializes the default field values for the radio primitive.
Declaration
protected override void InitializeFields()
Overrides
Remarks
This method configures the radio primitive with appropriate default settings including:
- Minimum size of 13x13 pixels for adequate visual representation
- Fixed sizing (no stretching) to maintain circular radio button appearance
- Default black colors for background and foreground elements
These defaults ensure that radio buttons maintain consistent visual appearance and proper sizing for user interaction across different layouts and scaling scenarios.
PaintPrimitive(IGraphics, float, SizeF)
Renders the radio button 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 radio button.
angle
The rotation angle in degrees to apply during rendering.
scale
The scaling factor to apply during rendering.
Overrides
Remarks
This method performs comprehensive radio button rendering including parameter validation, gradient color setup, and shape-based or rectangular rendering depending on configuration.
The rendering process supports up to 4 gradient colors and automatically handles different gradient styles, parent shape inheritance, and various radio button visual states.