Class RadioPrimitive
Represents a primitive element that renders radio button indicators with circular selection states.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.Primitives
Assembly: Telerik.WinControls.dll
Syntax
public class RadioPrimitive : FillPrimitive, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, IPrimitive, IFillElement, IPrimitiveElement, IShapedElement
Remarks
RadioPrimitive extends FillPrimitive to provide radio button-specific rendering capabilities, including circular selection indicators and mutually exclusive selection behavior support. It renders the visual representation of radio button states (selected/unselected).
The primitive supports various visual styles and can render gradient fills, custom shapes, and different color schemes for the radio button indicator. It typically displays as a circular element with a filled center when selected.
RadioPrimitive is commonly used in radio button controls, option lists, and other UI elements that require mutually exclusive selection indicators.
Constructors
RadioPrimitive()
Declaration
public RadioPrimitive()
Fields
UseParentShapeProperty
Properties
UseParentShape
Gets or sets a value indicating whether this primitive should use its parent's shape for rendering.
Declaration
[RadPropertyDefaultValue("UseParentShape", typeof(RadioPrimitive))]
public bool UseParentShape { get; set; }
Property Value
System.Boolean
|
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
CheckForValidParameters()
Declaration
protected virtual bool CheckForValidParameters()
Returns
System.Boolean
|
CreatePath(Rectangle)
Declaration
protected virtual GraphicsPath CreatePath(Rectangle rect)
Parameters
System.Drawing.Rectangle
rect
|
Returns
System.Drawing.Drawing2D.GraphicsPath
|
GetClientRect()
Declaration
protected virtual Rectangle GetClientRect()
Returns
System.Drawing.Rectangle
|
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, Single, 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
IGraphics
graphics
The graphics context to use for rendering the radio button. |
System.Single
angle
The rotation angle in degrees to apply during rendering. |
System.Drawing.SizeF
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.
PaintPrimitiveCore(IGraphics, Rectangle, Color[], Single[], GraphicsPath)
Declaration
protected virtual void PaintPrimitiveCore(IGraphics g, Rectangle rect, Color[] colorStops, float[] colorOffsets, GraphicsPath graphPath)
Parameters
IGraphics
g
|
System.Drawing.Rectangle
rect
|
System.Drawing.Color[]
colorStops
|
System.Single[]
colorOffsets
|
System.Drawing.Drawing2D.GraphicsPath
graphPath
|