RadioPrimitive
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
public RadioPrimitive()
Fields
public static RadProperty UseParentShapeProperty
Properties
Gets or sets a value indicating whether this primitive should use its parent's shape for rendering.
public bool UseParentShape { get; set; }
true if the primitive should inherit and use the parent element's shape; otherwise, false.
The default value is true.
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
Initializes the default field values for the radio primitive.
protected override void InitializeFields()
Overrides:
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.
Renders the radio button 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 radio button.
anglefloatThe rotation angle in degrees to apply during rendering.
scaleSizeFThe scaling factor to apply during rendering.
Overrides:
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.
protected virtual void PaintPrimitiveCore(IGraphics g, Rectangle rect, Color[] colorStops, float[] colorOffsets, GraphicsPath graphPath)