ClassLightVisualElement
Represents a lightweight visual element that supports text, border, image, background color, and foreground color with various layout adjustments. This element provides efficient rendering capabilities for common UI scenarios while implementing text and image primitive interfaces.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class LightVisualElement : UIItemBase, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElement
Derived Classes:
Implements:
Inherited Members
Constructors
LightVisualElement()
Declaration
public LightVisualElement()
Fields
BackgroundImageLayoutProperty
Declaration
public static RadProperty BackgroundImageLayoutProperty
Field Value
BackgroundImageProperty
Declaration
public static RadProperty BackgroundImageProperty
Field Value
BorderBottomColorProperty
Declaration
public static RadProperty BorderBottomColorProperty
Field Value
BorderBottomShadowColorProperty
Declaration
public static RadProperty BorderBottomShadowColorProperty
Field Value
BorderBottomWidthProperty
Declaration
public static RadProperty BorderBottomWidthProperty
Field Value
BorderBoxStyleProperty
Declaration
public static RadProperty BorderBoxStyleProperty
Field Value
BorderColor2Property
Declaration
public static RadProperty BorderColor2Property
Field Value
BorderColor3Property
Declaration
public static RadProperty BorderColor3Property
Field Value
BorderColor4Property
Declaration
public static RadProperty BorderColor4Property
Field Value
BorderDashPatternProperty
Declaration
public static RadProperty BorderDashPatternProperty
Field Value
BorderDashStyleProperty
Declaration
public static RadProperty BorderDashStyleProperty
Field Value
BorderDrawModeProperty
Declaration
public static RadProperty BorderDrawModeProperty
Field Value
BorderGradientAngleProperty
Declaration
public static RadProperty BorderGradientAngleProperty
Field Value
BorderGradientStyleProperty
Declaration
public static RadProperty BorderGradientStyleProperty
Field Value
BorderInnerColor2Property
Declaration
public static RadProperty BorderInnerColor2Property
Field Value
BorderInnerColor3Property
Declaration
public static RadProperty BorderInnerColor3Property
Field Value
BorderInnerColor4Property
Declaration
public static RadProperty BorderInnerColor4Property
Field Value
BorderInnerColorProperty
Declaration
public static RadProperty BorderInnerColorProperty
Field Value
BorderLeftColorProperty
Declaration
public static RadProperty BorderLeftColorProperty
Field Value
BorderLeftShadowColorProperty
Declaration
public static RadProperty BorderLeftShadowColorProperty
Field Value
BorderLeftWidthProperty
Declaration
public static RadProperty BorderLeftWidthProperty
Field Value
BorderRightColorProperty
Declaration
public static RadProperty BorderRightColorProperty
Field Value
BorderRightShadowColorProperty
Declaration
public static RadProperty BorderRightShadowColorProperty
Field Value
BorderRightWidthProperty
Declaration
public static RadProperty BorderRightWidthProperty
Field Value
BorderTopColorProperty
Declaration
public static RadProperty BorderTopColorProperty
Field Value
BorderTopShadowColorProperty
Declaration
public static RadProperty BorderTopShadowColorProperty
Field Value
BorderTopWidthProperty
Declaration
public static RadProperty BorderTopWidthProperty
Field Value
DisabledTextRenderingHintProperty
Declaration
public static RadProperty DisabledTextRenderingHintProperty
Field Value
DrawBackgroundImageProperty
Declaration
public static RadProperty DrawBackgroundImageProperty
Field Value
EnableImageTransparencyProperty
Declaration
public static RadProperty EnableImageTransparencyProperty
Field Value
GradientAngleProperty
Declaration
public static RadProperty GradientAngleProperty
Field Value
GradientPercentage2Property
Declaration
public static RadProperty GradientPercentage2Property
Field Value
GradientPercentageProperty
Declaration
public static RadProperty GradientPercentageProperty
Field Value
GradientStyleProperty
Declaration
public static RadProperty GradientStyleProperty
Field Value
HorizontalLineColorProperty
Declaration
public static RadProperty HorizontalLineColorProperty
Field Value
HorizontalLineWidthProperty
Declaration
public static RadProperty HorizontalLineWidthProperty
Field Value
ImageAlignmentProperty
Declaration
public static RadProperty ImageAlignmentProperty
Field Value
ImageOpacityProperty
Declaration
public static RadProperty ImageOpacityProperty
Field Value
ImageTransparentColorProperty
Declaration
public static RadProperty ImageTransparentColorProperty
Field Value
NumberOfColorsProperty
Declaration
public static RadProperty NumberOfColorsProperty
Field Value
ShowHorizontalLineProperty
Declaration
public static RadProperty ShowHorizontalLineProperty
Field Value
TextAlignmentProperty
Declaration
public static RadProperty TextAlignmentProperty
Field Value
TextImageRelationProperty
Declaration
public static RadProperty TextImageRelationProperty
Field Value
TextRenderingHintProperty
Declaration
public static RadProperty TextRenderingHintProperty
Field Value
Properties
AutoEllipsis
Gets or sets a value indicating whether automatic text ellipsis will be applied when text cannot fit within the available space.
BackColor2
Gets or sets the second background color used in gradient fill effects for multi-color gradient styles.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BackColor2 { get; set; }
Property Value
Overrides
BackColor3
Gets or sets the third background color used in gradient fill effects for multi-color gradient styles.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BackColor3 { get; set; }
Property Value
Overrides
BackColor4
Gets or sets the fourth background color used in gradient fill effects for multi-color gradient styles.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BackColor4 { get; set; }
Property Value
Overrides
BackgroundImage
Gets or sets the background image displayed behind the element's content. This image is rendered according to the BackgroundImageLayout property.
Declaration
[TypeConverter(typeof(ImageTypeConverter))]
public virtual Image BackgroundImage { get; set; }
Property Value
BackgroundImageLayout
Gets or sets the layout mode for the background image, determining how it is positioned and scaled within the element bounds.
Declaration
public virtual ImageLayout BackgroundImageLayout { get; set; }
Property Value
BorderBottomColor
Gets or sets the color of the bottom border when using FourBorders style.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderBottomColor { get; set; }
Property Value
Overrides
BorderBottomShadowColor
Gets or sets the shadow color for the bottom border, providing a visual depth effect when rendered.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderBottomShadowColor { get; set; }
Property Value
Overrides
BorderBottomWidth
Gets or sets the width of the bottom border when using FourBorders style. This value is automatically scaled based on the current DPI settings of the display.
Declaration
public override float BorderBottomWidth { get; set; }
Property Value
Overrides
BorderBoxStyle
Gets or sets the border drawing style that determines how border appearance is configured. SingleBorder applies uniform appearance to all sides, while FourBorders allows individual configuration of each side's color, width, and shadow properties.
Declaration
public override BorderBoxStyle BorderBoxStyle { get; set; }
Property Value
Overrides
BorderColor
Gets or sets the primary border color used for solid borders or as the first color in gradient border effects.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderColor { get; set; }
Property Value
Overrides
BorderColor2
Gets or sets the second color used in gradient border effects for radial, glass, office glass, gel, and vista gradient styles.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderColor2 { get; set; }
Property Value
Overrides
BorderColor3
Gets or sets the third color used in gradient border effects for radial, glass, office glass, and vista gradient styles.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderColor3 { get; set; }
Property Value
Overrides
BorderColor4
Gets or sets the fourth color used in gradient border effects for radial, glass, office glass, and vista gradient styles.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderColor4 { get; set; }
Property Value
Overrides
BorderDashPattern
Gets or sets the custom dash pattern array for border rendering when using custom dashed line styles.
Declaration
public override float[] BorderDashPattern { get; set; }
Property Value
float[]
Overrides
BorderDashStyle
Gets or sets the style of dashed lines used for border rendering when dashed border effects are applied.
Declaration
public override DashStyle BorderDashStyle { get; set; }
Property Value
Overrides
BorderDrawMode
Gets or sets the drawing order for border lines when using FourBorders style. This property determines which border lines are drawn on top when borders overlap at corners.
Declaration
public override BorderDrawModes BorderDrawMode { get; set; }
Property Value
Overrides
BorderGradientAngle
Gets or sets the angle in degrees for linear gradient borders. This property determines the direction of the gradient effect when BorderGradientStyle is set to linear gradient.
Declaration
public override float BorderGradientAngle { get; set; }
Property Value
Overrides
BorderGradientStyle
Gets or sets the gradient style for border rendering. Available styles include solid, linear, radial, glass, office glass, gel, and vista. Each style provides different visual effects for the border appearance.
Declaration
public override GradientStyles BorderGradientStyle { get; set; }
Property Value
Overrides
BorderInnerColor
Gets or sets the primary inner border color used in outer-inner border configurations for gradient border effects.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderInnerColor { get; set; }
Property Value
Overrides
BorderInnerColor2
Gets or sets the second inner border color used in outer-inner border configurations for gradient border effects.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderInnerColor2 { get; set; }
Property Value
Overrides
BorderInnerColor3
Gets or sets the third inner border color used in outer-inner border configurations for gradient border effects.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderInnerColor3 { get; set; }
Property Value
Overrides
BorderInnerColor4
Gets or sets the fourth inner border color used in outer-inner border configurations for gradient border effects.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderInnerColor4 { get; set; }
Property Value
Overrides
BorderLeftColor
Gets or sets the color of the left border when using FourBorders style.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderLeftColor { get; set; }
Property Value
Overrides
BorderLeftShadowColor
Gets or sets the shadow color for the left border, providing a visual depth effect when rendered.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderLeftShadowColor { get; set; }
Property Value
Overrides
BorderLeftWidth
Gets or sets the width of the left border when using FourBorders style. This value is automatically scaled based on the current DPI settings of the display.
Declaration
public override float BorderLeftWidth { get; set; }
Property Value
Overrides
BorderRightColor
Gets or sets the color of the right border when using FourBorders style.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderRightColor { get; set; }
Property Value
Overrides
BorderRightShadowColor
Gets or sets the shadow color for the right border, providing a visual depth effect when rendered.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderRightShadowColor { get; set; }
Property Value
Overrides
BorderRightWidth
Gets or sets the width of the right border when using FourBorders style. This value is automatically scaled based on the current DPI settings of the display.
Declaration
public override float BorderRightWidth { get; set; }
Property Value
Overrides
BorderTopColor
Gets or sets the color of the top border when using FourBorders style.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderTopColor { get; set; }
Property Value
Overrides
BorderTopShadowColor
Gets or sets the shadow color for the top border, providing a visual depth effect when rendered.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderTopShadowColor { get; set; }
Property Value
Overrides
BorderTopWidth
Gets or sets the width of the top border when using FourBorders style. This value is automatically scaled based on the current DPI settings of the display.
Declaration
public override float BorderTopWidth { get; set; }
Property Value
Overrides
BorderWidth
Gets or sets the uniform width of all border sides when using SingleBorder style. This value is automatically scaled based on the current DPI settings of the display.
Declaration
public override float BorderWidth { get; set; }
Property Value
Overrides
CanFocus
Gets or sets a value indicating whether the element can receive input focus.
Declaration
public override bool CanFocus { get; set; }
Property Value
Overrides
ClipText
Gets or sets a value indicating whether text should be clipped to the calculated text painting rectangle boundaries.
DisableHTMLRendering
Gets or sets a value indicating whether HTML formatting in text content should be disabled, forcing plain text rendering.
DisabledImageOpacity
Gets or sets the opacity level applied to images when they are in a disabled state.
Declaration
public virtual double DisabledImageOpacity { get; set; }
Property Value
Remarks
If the value is set to a number outside the range 0.0 to 1.0, the property will use the value of the ImageOpacity property instead. The opacity value must be between 0.0 (fully transparent) and 1.0 (fully opaque).
DisabledTextRenderingHint
Gets or sets the text rendering hint used specifically when this element is in a disabled state. This allows for different text rendering quality when the element is disabled versus enabled.
Declaration
public virtual TextRenderingHint DisabledTextRenderingHint { get; set; }
Property Value
DrawBackgroundImage
Gets or sets a value indicating whether the element should render its background image during the paint operation. This property controls the visibility of the image specified by the BackgroundImage property.
DrawBorder
Gets or sets a value indicating whether the element should render its border during the paint operation. This property controls the visibility of all border styles including single borders, four borders, and outer-inner borders.
Declaration
public override bool DrawBorder { get; set; }
Property Value
Overrides
DrawFill
Gets or sets a value indicating whether the element should render its background fill during the paint operation. This property controls the visibility of gradient fills, solid colors, and other background painting effects.
Declaration
public override bool DrawFill { get; set; }
Property Value
Overrides
DrawImage
Gets or sets a value indicating whether the element should render its main image during the paint operation. This property controls the visibility of the image specified by the Image property.
DrawText
Gets or sets a value indicating whether the element should render its text content during the paint operation. When set to false, the text will not be visible even if the text property is set.
EnableImageTransparency
Gets or sets a value indicating whether image transparency effects are enabled for this element.
GradientAngle
Gets or sets the angle in degrees for linear gradient background effects. This determines the direction of the gradient.
Declaration
public override float GradientAngle { get; set; }
Property Value
Overrides
GradientPercentage
Gets or sets the first gradient percentage that controls the distribution of colors in gradient background effects.
Declaration
public override float GradientPercentage { get; set; }
Property Value
Overrides
GradientPercentage2
Gets or sets the second gradient percentage that controls the distribution of colors in gradient background effects.
Declaration
public override float GradientPercentage2 { get; set; }
Property Value
Overrides
GradientStyle
Gets or sets the gradient style for background fill rendering. Available styles include solid, linear, radial, glass, office glass, gel, and vista.
Declaration
public override GradientStyles GradientStyle { get; set; }
Property Value
Overrides
HorizontalLineColor
Gets or sets the color of the horizontal line when ShowHorizontalLine is enabled.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color HorizontalLineColor { get; set; }
Property Value
HorizontalLineWidth
Gets or sets the width in pixels of the horizontal line when ShowHorizontalLine is enabled. This value is automatically scaled based on current DPI settings.
Declaration
public virtual int HorizontalLineWidth { get; set; }
Property Value
Image
Gets or sets the main image displayed on the element. The image position is controlled by ImageAlignment and TextImageRelation properties.
Declaration
[TypeConverter(typeof(ImageTypeConverter))]
public virtual Image Image { get; set; }
Property Value
Implements
ImageAlignment
Gets or sets the alignment of the image within the element bounds, controlling both horizontal and vertical positioning.
Declaration
public virtual ContentAlignment ImageAlignment { get; set; }
Property Value
ImageDrawType
Gets or sets the type of image to draw, determining whether to render bitmap images or SVG images based on availability and configuration. Determines whether the Image or SvgImage property will be painted. Note that if SvgImage == null, this property will always return "ImageDrawType.Image".
Declaration
[Browsable(false)]
public virtual ImageDrawType ImageDrawType { get; set; }
Property Value
ImageIndex
Gets or sets the index of the image from the associated to display on this element.
Declaration
[RelatedImageList("ElementTree.Control.ImageList")]
[TypeConverter("Telerik.WinControls.UI.Design.NoneExcludedImageIndexConverter, Telerik.WinControls.UI.Design, Version=2026.1.217.48, Culture=neutral, PublicKeyToken=5bb2a467cbec794e")]
public virtual int ImageIndex { get; set; }
Property Value
Implements
ImageKey
Gets or sets the key of the image from the associated to display on this element.
Declaration
[TypeConverter("Telerik.WinControls.UI.Design.RadImageKeyConverter, Telerik.WinControls.UI.Design, Version=2026.1.217.48, Culture=neutral, PublicKeyToken=5bb2a467cbec794e")]
public virtual string ImageKey { get; set; }
Property Value
Implements
ImageLayout
Gets or sets the layout mode for the main image, determining how it is positioned and scaled within the element bounds.
Declaration
public virtual ImageLayout ImageLayout { get; set; }
Property Value
ImageOpacity
Gets or sets the opacity level for image rendering, where 1.0 represents fully opaque and 0.0 represents fully transparent.
Declaration
public virtual double ImageOpacity { get; set; }
Property Value
ImageTransparentColor
Gets or sets the color that will be treated as transparent when rendering images on this element.
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public Color ImageTransparentColor { get; set; }
Property Value
Layout
Gets the layout manager that controls the positioning and sizing of text and image content within this element.
Declaration
public virtual LayoutManagerPart Layout { get; }
Property Value
MeasureTrailingSpaces
Gets or sets a value indicating whether trailing spaces in text should be included in text measurement calculations.
Declaration
[Browsable(false)]
public bool MeasureTrailingSpaces { get; set; }
Property Value
Implements
NumberOfColors
Gets or sets the number of colors used in gradient background effects. This determines how many color properties are utilized.
Declaration
public override int NumberOfColors { get; set; }
Property Value
Overrides
ShouldPaint
Gets or sets a value indicating whether the element should be painted.
Declaration
public override bool ShouldPaint { get; set; }
Property Value
Overrides
Remarks
Children visibility is not be affected.
ShowHorizontalLine
Gets or sets a value indicating whether a horizontal line should be rendered across the element.
Declaration
public virtual bool ShowHorizontalLine { get; set; }
Property Value
ShowKeyboardCues
Gets or sets a value indicating whether keyboard access cues (underlines for mnemonics) should be displayed for this element.
Declaration
[Browsable(false)]
public virtual bool ShowKeyboardCues { get; set; }
Property Value
Implements
SvgImage
Gets or sets the SVG image to be displayed on this element as a scalable vector graphic.
Declaration
public virtual RadSvgImage SvgImage { get; set; }
Property Value
TextAlignment
Gets or sets the alignment of text within the element bounds, controlling both horizontal and vertical positioning.
Declaration
public virtual ContentAlignment TextAlignment { get; set; }
Property Value
Implements
TextImageRelation
Gets or sets the spatial relationship between text and image content. This determines how text and image are positioned relative to each other.
Declaration
public TextImageRelation TextImageRelation { get; set; }
Property Value
TextParams
This property is not relevant for this class.
TextRenderingHint
Gets or sets the text rendering hint that determines the quality and anti-aliasing mode used when rendering text on this element. This property affects the visual appearance and readability of text displayed by the element.
Declaration
public virtual TextRenderingHint TextRenderingHint { get; set; }
Property Value
TextWrap
Gets or sets a value indicating whether text will automatically wrap to multiple lines when it exceeds the element's width.
Declaration
public virtual bool TextWrap { get; set; }
Property Value
Implements
UseMnemonic
Gets or sets a value indicating whether ampersand characters (&) in text will be treated as mnemonic access key indicators.
Declaration
public virtual bool UseMnemonic { get; set; }
Property Value
Implements
Methods
ArrangeElement(RadElement, SizeF)
Arranges a single child element according to its fit-to-size mode within the allocated space.
Declaration
protected virtual void ArrangeElement(RadElement element, SizeF finalSize)
Parameters
element
The child element to arrange.
finalSize
The final size available for arranging the element.
ArrangeOverride(SizeF)
Arranges the content and child elements within the final allocated space, positioning text, images, and child elements.
CalculateDesiredSize(SizeF, SizeF, SizeF)
Calculates the final desired size by combining the element's content size with child elements' size requirements.
Declaration
protected virtual SizeF CalculateDesiredSize(SizeF availableSize, SizeF desiredSize, SizeF elementsDesiredSize)
Parameters
availableSize
The available space that a parent element can allocate.
desiredSize
The desired size calculated from content and layout requirements.
elementsDesiredSize
The desired size calculated from child elements.
Returns
The final desired size taking into account all size constraints.
ClipImage(Image, Rectangle, Size)
Clips an image to fit within the specified rectangle and size constraints, creating a new image if necessary.
Declaration
protected virtual Image ClipImage(Image image, Rectangle imageRectange, Size size)
Parameters
image
The source image to clip.
imageRectange
The rectangle defining the clipping area within the source image.
size
The target size for the clipped image.
Returns
The clipped image, or the original image if no clipping is needed.
DisposeManagedResources()
Disposes of managed resources including cached images and SVG images when the element is being disposed.
Declaration
protected override void DisposeManagedResources()
Overrides
DrawHorizontalLine(IGraphics)
Draws a horizontal line across the element when text is present, positioning the line based on text alignment and size.
Declaration
protected virtual void DrawHorizontalLine(IGraphics graphics)
Parameters
graphics
The graphics context used for rendering the horizontal line.
DrawHorizontalLineWithoutText(IGraphics)
Draws a horizontal line across the element when no text is present and ShowHorizontalLine is enabled.
Declaration
protected virtual void DrawHorizontalLineWithoutText(IGraphics graphics)
Parameters
graphics
The graphics context used for rendering the horizontal line.
GetBorderThickness(LightVisualElement, bool)
Calculates the border thickness for a LightVisualElement based on its border configuration and drawing state.
Declaration
public static Padding GetBorderThickness(LightVisualElement element, bool checkDrawBorder)
Parameters
element
The LightVisualElement instance to calculate border thickness for.
checkDrawBorder
When true, returns zero thickness if DrawBorder is false; otherwise ignores the drawing state.
Returns
A Padding structure representing the calculated border thickness for all sides.
GetBorderThickness(bool)
Gets the border thickness for this element instance by delegating to the static GetBorderThickness(LightVisualElement, bool) method.
Declaration
protected virtual Padding GetBorderThickness(bool checkDrawBorder)
Parameters
checkDrawBorder
When true, returns zero thickness if DrawBorder is false.
Returns
A Padding structure representing the border thickness.
GetClientOffset(bool)
Calculates the client area offset by combining padding and optionally border thickness.
GetClientRectangle(SizeF)
Declaration
protected override RectangleF GetClientRectangle(SizeF finalSize)
Parameters
finalSize
Returns
Overrides
GetClientRectangle(bool, SizeF)
Calculates the client rectangle area available for content within the element bounds, optionally including border space.
Declaration
protected virtual RectangleF GetClientRectangle(bool includeBorder, SizeF finalSize)
Parameters
includeBorder
When true, accounts for border thickness in the client rectangle calculation.
finalSize
The total size of the element from which to calculate the client rectangle.
Returns
A RectangleF representing the available client area for content.
GetClipRect()
Calculates the clipping rectangle for this element, taking into account border thickness and padding.
Declaration
protected override RectangleF GetClipRect()
Returns
A RectangleF representing the clipping bounds for content rendering.
Overrides
GetImageDrawTypeLocalValue()
Declaration
protected ImageDrawType? GetImageDrawTypeLocalValue()
Returns
GetPaintingBorderWidth()
Gets the border width that should be used for painting operations, typically inherited from the parent element.
Declaration
public override float GetPaintingBorderWidth()
Returns
The border width in pixels, or 0 if no parent element is available.
Overrides
GetStylablePropertiesFilter()
Gets the IFilter instance that may be used to filter the properties, treated as Stylable for this element.
Declaration
public override Filter GetStylablePropertiesFilter()
Returns
Overrides
GetTextAlignment()
Declaration
protected ContentAlignment GetTextAlignment()
Returns
GetTextAlignment(ContentAlignment)
Declaration
protected ContentAlignment GetTextAlignment(ContentAlignment textAlignment)
Parameters
textAlignment
Returns
GetTextSize(SizeF, TextParams)
Calculates the size required to display the text content within the proposed size constraints.
Declaration
public SizeF GetTextSize(SizeF proposedSize, TextParams textParams)
Parameters
proposedSize
The proposed size constraints for the text measurement.
textParams
The text parameters containing formatting and display options.
Returns
A SizeF representing the calculated text size.
Implements
GetTextSize(TextParams)
Calculates the size required to display the text content using the specified text parameters.
Declaration
public SizeF GetTextSize(TextParams textParams)
Parameters
textParams
The text parameters containing formatting and display options.
Returns
A SizeF representing the calculated text size.
Implements
InitializeFields()
Initializes the internal fields and components of the LightVisualElement. This method sets up text primitives, image primitives, and layout management components.
Declaration
protected override void InitializeFields()
Overrides
MapStyleProperty(RadProperty, string)
Maps a style property to another property. This method is used to map corresponding properties of LightVisualElement instances and BasePrimitive instances.
Declaration
public override RadProperty MapStyleProperty(RadProperty propertyToMap, string settingType)
Parameters
propertyToMap
An instance of the RadProperty class that represents the property to map.
settingType
Returns
An instance of the RadProperty class which represents the mapped property. If no property is found, the method returns null
Overrides
MeasureElements(SizeF, SizeF, Padding)
Measures all child elements when auto-sizing is enabled, calculating the space required for child elements.
Declaration
protected virtual SizeF MeasureElements(SizeF availableSize, SizeF clientSize, Padding borderThickness)
Parameters
availableSize
The available space that a parent element can allocate.
clientSize
The client area size available for content.
borderThickness
The thickness of the border that affects available space.
Returns
The desired size needed to accommodate all child elements.
MeasureOverride(SizeF)
Measures the desired size of the element by calculating the space needed for content, padding, and borders.
MeasureOverride(SizeF, TextParams)
Measures the desired size of the text content given the available space and text parameters.
Declaration
public SizeF MeasureOverride(SizeF availableSize, TextParams textParams)
Parameters
availableSize
The available space for measuring the text content.
textParams
The text parameters containing formatting and display options.
Returns
A SizeF representing the desired size of the text content.
Implements
OnAnimatedImageFrameChanged()
Called when animated image frame changes.
Declaration
protected virtual void OnAnimatedImageFrameChanged()
OnBitStateChanged(long, bool, bool)
Handles state changes for bit flags, particularly managing text primitive implementation when HTML rendering is disabled.
OnLoaded()
Called when the element has been successfully loaded. That includes loading of all its children as well.
Declaration
protected override void OnLoaded()
Overrides
OnMouseMove(MouseEventArgs)
Called when the mouse moves over the item, handling highlight and border highlight effects.
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
e
The mouse event arguments.
Overrides
OnMouseMove(object, MouseEventArgs)
Handles mouse movement events for the text primitive, enabling text interaction features.
Declaration
public void OnMouseMove(object sender, MouseEventArgs e)
Parameters
sender
The source of the mouse move event.
e
The MouseEventArgs containing event data.
Implements
OnPropertyChanged(RadPropertyChangedEventArgs)
Handles property change events by invalidating the fill cache and invoking the base class property change handler.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
e
Event arguments containing information about the property that changed.
Overrides
OnTunnelEvent(RadElement, RoutedEventArgs)
Called when the tunnel phase of a routed event occurs.
Declaration
protected override void OnTunnelEvent(RadElement sender, RoutedEventArgs args)
Parameters
sender
The element that originally raised the event.
args
The routed event arguments.
Overrides
PaintBackgroundImage(IGraphics)
Renders the background image of the element according to the specified BackgroundImageLayout setting.
Declaration
protected virtual void PaintBackgroundImage(IGraphics graphics)
Parameters
graphics
The graphics context used for rendering the background image.
PaintContent(IGraphics)
Orchestrates the painting of all content elements including background image, main image or SVG image, and text.
Declaration
protected virtual void PaintContent(IGraphics graphics)
Parameters
graphics
The graphics context used for rendering content.
PaintElement(IGraphics, float, SizeF)
Performs the main painting operation for the element, rendering fill, content, and border in the correct order.
Declaration
protected override void PaintElement(IGraphics graphics, float angle, SizeF scale)
Parameters
graphics
The graphics context used for rendering.
angle
The rotation angle to apply during painting.
scale
The scaling factor to apply during painting.
Overrides
PaintImage(IGraphics)
Renders the main image of the element, handling image animation and thread-safe access to the cached image.
Declaration
protected virtual void PaintImage(IGraphics graphics)
Parameters
graphics
The graphics context used for rendering the image.
PaintPrimitive(IGraphics, TextParams)
Paints the text primitive with the specified graphics context and text parameters.
Declaration
public void PaintPrimitive(IGraphics graphics, TextParams textParams)
Parameters
graphics
The graphics context used for painting.
textParams
The text parameters containing formatting and display options.
Implements
PaintPrimitive(IGraphics, float, SizeF, TextParams)
Paints the text primitive with the specified graphics context, transformation, and text parameters.
Declaration
public void PaintPrimitive(IGraphics graphics, float angle, SizeF scale, TextParams textParams)
Parameters
graphics
The graphics context used for painting.
angle
The rotation angle to apply during painting.
scale
The scale factor to apply during painting.
textParams
The text parameters containing formatting and display options.
Implements
PaintSvgImage(IGraphics)
Renders the SVG image of the element when an SvgImage is available and image drawing is enabled.
Declaration
protected virtual void PaintSvgImage(IGraphics graphics)
Parameters
graphics
The graphics context used for rendering the SVG image.
PaintText(IGraphics)
Renders the text content of the element, including horizontal line effects when enabled.
Declaration
protected virtual void PaintText(IGraphics graphics)
Parameters
graphics
The graphics context used for rendering text.
PaintTextCore(IGraphics)
Declaration
protected void PaintTextCore(IGraphics graphics)
Parameters
graphics
ShouldSerializeProperty(PropertyDescriptor)
Determines whether the property defined by the provided property descriptor should be serialized.
Declaration
public override bool? ShouldSerializeProperty(PropertyDescriptor property)
Parameters
property
Returns
bool?
Overrides
ToggleTextPrimitive(RadProperty)
Toggles the text primitive when text related properties are change.
Declaration
protected virtual void ToggleTextPrimitive(RadProperty property)
Parameters
property
The changed property.