FillPrimitive
Represents a primitive element that renders background fills and gradients.
FillPrimitive is used to paint solid colors, gradients, and other fill patterns as the background of RadElements. It supports various gradient styles including linear, radial, elliptical, and more.
The fill can be configured with multiple colors (up to 4) and various gradient properties such as angle, percentage positions, and gradient style to create complex visual effects.
This primitive is commonly used as a background element in most Telerik controls to provide visual styling and theming capabilities.
Definition
Namespace:Telerik.WinControls.Primitives
Assembly:Telerik.WinControls.dll
Syntax:
public class FillPrimitive : BasePrimitive, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, IPrimitive, IFillElement, IPrimitiveElement, IShapedElement
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementBasePrimitiveFillPrimitive...
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a fill primitive with paint-buffer reuse enabled.
public FillPrimitive()
Fields
Identifies the second color stop used by multi-color fill gradients.
public static RadProperty BackColor2Property
Identifies the third color stop used by multi-color fill gradients.
public static RadProperty BackColor3Property
Identifies the fourth color stop used by multi-color fill gradients.
public static RadProperty BackColor4Property
Identifies the angle, in degrees, used for linear fill gradients.
public static RadProperty GradientAngleProperty
Identifies the second intermediate gradient-stop position.
public static RadProperty GradientPercentage2Property
Identifies the first intermediate gradient-stop position.
public static RadProperty GradientPercentageProperty
Identifies the fill effect selected for rendering the background.
public static RadProperty GradientStyleProperty
Identifies how many fill colors are supplied to gradient rendering; some styles use a fixed number.
public static RadProperty NumberOfColorsProperty
Identifies whether the fill follows the parent element's shape.
public static RadProperty PaintUsingParentShapeProperty
Properties
Gets or sets background color. This property is applicable to radial, glass, office glass, gel, and vista gradients.
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color BackColor2 { get; set; }
Implements:
Gets or sets background color. This property is applicable to radial, glass, office glass, and vista gradients.
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color BackColor3 { get; set; }
Implements:
Gets or sets background color. This property is applicable to radial, glass, office glass, and vista gradients.
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color BackColor4 { get; set; }
Implements:
Gets or sets how the fill is sized relative to its parent element.
public override RadFitToSizeMode FitToSizeMode { get; set; }
Overrides:
Gets or sets gradient angle for linear gradient.
public virtual float GradientAngle { get; set; }
Implements:
Gets or sets GradientPercentage for linear, glass, office glass, gel, vista, and radial gradients.
public virtual float GradientPercentage { get; set; }
Implements:
Gets or sets GradientPercentage for office glass, vista, and radial gradients.
public virtual float GradientPercentage2 { get; set; }
Implements:
Gets and sets the gradient style. The possible values are defined in the gradient style enumeration: solid, linear, radial, glass, office glass, gel, and vista.
public virtual GradientStyles GradientStyle { get; set; }
Implements:
Gets or sets the number of used colors in the gradient effect.
public virtual int NumberOfColors { get; set; }
Implements:
Specifies whether the FillPrimitive should fill the GraphicsPath defined by its Parent.Shape. If false, it will fill its bounding rectangle.
public bool PaintUsingParentShape { get; set; }
Uses PaintUsingParentShape to determine whether fill rendering follows the parent shape.
protected override bool ShouldPaintUsingParentShape { get; }
Overrides:
Methods
Supplies fill-specific defaults for auto-sizing, parent fitting, and smoothing.
protected override object GetDefaultValue(RadPropertyValue propVal, object baseDefaultValue)
The property value being initialized.
baseDefaultValueobjectThe default value supplied by the base implementation.
Returns:The fill-specific default for recognized properties, or baseDefaultValue otherwise.
Overrides:
Limits the properties exposed for styling to fill, appearance, and behavior settings.
public override Filter GetStylablePropertiesFilter()
A filter combining the fill, appearance, and behavior property groups.
Overrides:
Creates the fill renderer used by this primitive.
protected override void InitializeFields()
Overrides:
Notifies the fill renderer that the element's bounds changed so its cached fill can be refreshed.
protected override void OnBoundsChanged(RadPropertyChangedEventArgs e)
Information about the bounds change.
Overrides:
Invalidates cached fill data when a property changes.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Information about the property change.
Overrides:
Applies fill-specific rules when deciding whether designer serialization should include a property.
public override bool? ShouldSerializeProperty(PropertyDescriptor property)
bool?
Overrides:
Requests serialization for
SmoothingModewhen it is not AntiAlias and forFitToSizeModewhen it is not FitToParentBounds. Other properties use the base implementation.