LightVisualElement
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
public LightVisualElement()
Fields
Identifies the second background color used by multi-color fill styles.
public static RadProperty BackColor2Property
Identifies the third background color used by multi-color fill styles.
public static RadProperty BackColor3Property
Identifies the fourth background color used by multi-color fill styles.
public static RadProperty BackColor4Property
Identifies how the background image is positioned and scaled within the element's bounds.
public static RadProperty BackgroundImageLayoutProperty
Identifies the image painted behind the element's content; rendering also depends on DrawBackgroundImage and BackgroundImageLayout.
public static RadProperty BackgroundImageProperty
Identifies the color used for the bottom edge in FourBorders mode.
public static RadProperty BorderBottomColorProperty
Identifies the shadow color applied to the bottom border edge.
public static RadProperty BorderBottomShadowColorProperty
Identifies the bottom-edge width used in FourBorders mode.
public static RadProperty BorderBottomWidthProperty
Identifies whether the border uses one uniform outline, four independent edges, or nested outlines.
public static RadProperty BorderBoxStyleProperty
Identifies the second color used by multi-color border gradient styles.
public static RadProperty BorderColor2Property
Identifies the third color used by border gradient styles that support at least three colors.
public static RadProperty BorderColor3Property
Identifies the fourth color used by border gradient styles that support four colors.
public static RadProperty BorderColor4Property
Identifies the primary color used by solid and gradient border rendering.
public static RadProperty BorderColorProperty
Identifies the custom dash-and-gap sequence used when the border dash style is custom.
public static RadProperty BorderDashPatternProperty
Identifies the dash style applied to border lines.
public static RadProperty BorderDashStyleProperty
Identifies which border edge is drawn over another when four-border edges overlap.
public static RadProperty BorderDrawModeProperty
Identifies the angle in degrees used for a linear border gradient.
public static RadProperty BorderGradientAngleProperty
Identifies the gradient style used to render the border colors.
public static RadProperty BorderGradientStyleProperty
Identifies the second inner-border color used by OuterInnerBorders.
public static RadProperty BorderInnerColor2Property
Identifies the third inner-border color used by OuterInnerBorders.
public static RadProperty BorderInnerColor3Property
Identifies the fourth inner-border color used by OuterInnerBorders.
public static RadProperty BorderInnerColor4Property
Identifies the first inner-border color used by OuterInnerBorders.
public static RadProperty BorderInnerColorProperty
Identifies the color used for the left edge in FourBorders mode.
public static RadProperty BorderLeftColorProperty
Identifies the shadow color applied to the left border edge.
public static RadProperty BorderLeftShadowColorProperty
Identifies the left-edge width used in FourBorders mode.
public static RadProperty BorderLeftWidthProperty
Identifies the color used for the right edge in FourBorders mode.
public static RadProperty BorderRightColorProperty
Identifies the shadow color applied to the right border edge.
public static RadProperty BorderRightShadowColorProperty
Identifies the right-edge width used in FourBorders mode.
public static RadProperty BorderRightWidthProperty
Identifies the color used for the top edge in FourBorders mode.
public static RadProperty BorderTopColorProperty
Identifies the shadow color applied to the top border edge.
public static RadProperty BorderTopShadowColorProperty
Identifies the top-edge width used in FourBorders mode.
public static RadProperty BorderTopWidthProperty
Identifies the uniform border width used in SingleBorder mode.
public static RadProperty BorderWidthProperty
Identifies whether text is clipped to the calculated text-painting rectangle.
public static RadProperty ClipTextProperty
Identifies the text-rendering mode used for disabled elements when default disabled painting is active.
public static RadProperty DisabledTextRenderingHintProperty
Identifies whether the image behind the element's content is painted.
public static RadProperty DrawBackgroundImageProperty
Identifies whether the element paints its border; layout can still reserve border thickness independently.
public static RadProperty DrawBorderProperty
Identifies whether the element paints its background fill, including solid and gradient colors.
public static RadProperty DrawFillProperty
Identifies whether the element's main image is painted.
public static RadProperty DrawImageProperty
Identifies whether non-empty text is rendered by the element.
public static RadProperty DrawTextProperty
Identifies whether transparent-color processing is enabled for images.
public static RadProperty EnableImageTransparencyProperty
Identifies the direction, in degrees, of a linear background fill gradient.
public static RadProperty GradientAngleProperty
Identifies the second color-distribution percentage used by background gradients.
public static RadProperty GradientPercentage2Property
Identifies the first color-distribution percentage used by background gradients.
public static RadProperty GradientPercentageProperty
Identifies the rendering style used for the element's background fill.
public static RadProperty GradientStyleProperty
Identifies the color of the optional horizontal line.
public static RadProperty HorizontalLineColorProperty
Identifies the width of the optional horizontal line; the rendered width is scaled for the current DPI.
public static RadProperty HorizontalLineWidthProperty
Identifies the alignment of the main image within the element's bounds.
public static RadProperty ImageAlignmentProperty
Identifies the index of the main image in the associated .
public static RadProperty ImageIndexProperty
Identifies the key of the main image in the associated .
public static RadProperty ImageKeyProperty
Identifies how the main image is positioned and scaled within the element's bounds.
public static RadProperty ImageLayoutProperty
Identifies the opacity used for images; disabled rendering can override it through DisabledImageOpacity.
public static RadProperty ImageOpacityProperty
Identifies the main image, whose placement is coordinated with text by ImageAlignment and TextImageRelation.
public static RadProperty ImageProperty
Identifies the color treated as transparent when EnableImageTransparency is enabled.
public static RadProperty ImageTransparentColorProperty
Identifies how many background colors participate in the fill, including additional colors such as BackColor2.
public static RadProperty NumberOfColorsProperty
Identifies whether the element paints its optional horizontal line.
public static RadProperty ShowHorizontalLineProperty
Identifies the scalable vector image associated with the element.
public static RadProperty SvgImageProperty
Identifies the alignment of text within the element's bounds.
public static RadProperty TextAlignmentProperty
Identifies how the text and main image are arranged relative to each other or overlaid.
public static RadProperty TextImageRelationProperty
Identifies the rendering quality and anti-aliasing mode used for text.
public static RadProperty TextRenderingHintProperty
Identifies whether text wraps to additional lines when it exceeds the available width.
public static RadProperty TextWrapProperty
Properties
Gets or sets a value indicating whether automatic text ellipsis will be applied when text cannot fit within the available space.
public bool AutoEllipsis { get; set; }
Implements:
Gets or sets the second background color used in gradient fill effects for multi-color gradient styles.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BackColor2 { get; set; }
Overrides:
Gets or sets the third background color used in gradient fill effects for multi-color gradient styles.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BackColor3 { get; set; }
Overrides:
Gets or sets the fourth background color used in gradient fill effects for multi-color gradient styles.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BackColor4 { get; set; }
Overrides:
Gets or sets the background image displayed behind the element's content. This image is rendered according to the BackgroundImageLayout property.
[TypeConverter(typeof(ImageTypeConverter))]
public virtual Image BackgroundImage { get; set; }
Gets or sets the layout mode for the background image, determining how it is positioned and scaled within the element bounds.
public virtual ImageLayout BackgroundImageLayout { get; set; }
Gets or sets the color of the bottom border when using FourBorders style.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderBottomColor { get; set; }
Overrides:
Gets or sets the shadow color for the bottom border, providing a visual depth effect when rendered.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderBottomShadowColor { get; set; }
Overrides:
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.
public override float BorderBottomWidth { get; set; }
Overrides:
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.
public override BorderBoxStyle BorderBoxStyle { get; set; }
Overrides:
Gets or sets the primary border color used for solid borders or as the first color in gradient border effects.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderColor { get; set; }
Overrides:
Gets or sets the second color used in gradient border effects for radial, glass, office glass, gel, and vista gradient styles.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderColor2 { get; set; }
Overrides:
Gets or sets the third color used in gradient border effects for radial, glass, office glass, and vista gradient styles.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderColor3 { get; set; }
Overrides:
Gets or sets the fourth color used in gradient border effects for radial, glass, office glass, and vista gradient styles.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderColor4 { get; set; }
Overrides:
Gets or sets the custom dash pattern array for border rendering when using custom dashed line styles.
public override float[] BorderDashPattern { get; set; }
Overrides:
Gets or sets the style of dashed lines used for border rendering when dashed border effects are applied.
public override DashStyle BorderDashStyle { get; set; }
Overrides:
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.
public override BorderDrawModes BorderDrawMode { get; set; }
Overrides:
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.
public override float BorderGradientAngle { get; set; }
Overrides:
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.
public override GradientStyles BorderGradientStyle { get; set; }
Overrides:
Gets or sets the primary inner border color used in outer-inner border configurations for gradient border effects.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderInnerColor { get; set; }
Overrides:
Gets or sets the second inner border color used in outer-inner border configurations for gradient border effects.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderInnerColor2 { get; set; }
Overrides:
Gets or sets the third inner border color used in outer-inner border configurations for gradient border effects.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderInnerColor3 { get; set; }
Overrides:
Gets or sets the fourth inner border color used in outer-inner border configurations for gradient border effects.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderInnerColor4 { get; set; }
Overrides:
Gets or sets the color of the left border when using FourBorders style.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderLeftColor { get; set; }
Overrides:
Gets or sets the shadow color for the left border, providing a visual depth effect when rendered.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderLeftShadowColor { get; set; }
Overrides:
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.
public override float BorderLeftWidth { get; set; }
Overrides:
Gets or sets the color of the right border when using FourBorders style.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderRightColor { get; set; }
Overrides:
Gets or sets the shadow color for the right border, providing a visual depth effect when rendered.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderRightShadowColor { get; set; }
Overrides:
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.
public override float BorderRightWidth { get; set; }
Overrides:
Gets or sets the color of the top border when using FourBorders style.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderTopColor { get; set; }
Overrides:
Gets or sets the shadow color for the top border, providing a visual depth effect when rendered.
[TypeConverter(typeof(RadColorEditorConverter))]
public override Color BorderTopShadowColor { get; set; }
Overrides:
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.
public override float BorderTopWidth { get; set; }
Overrides:
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.
public override float BorderWidth { get; set; }
Overrides:
Gets or sets a value indicating whether the element can receive input focus.
public override bool CanFocus { get; set; }
Overrides:
Gets or sets a value indicating whether text should be clipped to the calculated text painting rectangle boundaries.
public bool ClipText { get; set; }
Gets or sets the opacity level applied to images when they are in a disabled state.
public virtual double DisabledImageOpacity { get; set; }
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).
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.
public virtual TextRenderingHint DisabledTextRenderingHint { get; set; }
Gets or sets a value indicating whether HTML formatting in text content should be disabled, forcing plain text rendering.
public bool DisableHTMLRendering { get; set; }
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.
public bool DrawBackgroundImage { get; set; }
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.
public override bool DrawBorder { get; set; }
Overrides:
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.
public override bool DrawFill { get; set; }
Overrides:
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.
public bool DrawImage { get; set; }
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.
public virtual bool DrawText { get; set; }
Gets or sets a value indicating whether image transparency effects are enabled for this element.
public bool EnableImageTransparency { get; set; }
Gets or sets the angle in degrees for linear gradient background effects. This determines the direction of the gradient.
public override float GradientAngle { get; set; }
Overrides:
Gets or sets the first gradient percentage that controls the distribution of colors in gradient background effects.
public override float GradientPercentage { get; set; }
Overrides:
Gets or sets the second gradient percentage that controls the distribution of colors in gradient background effects.
public override float GradientPercentage2 { get; set; }
Overrides:
Gets or sets the gradient style for background fill rendering. Available styles include solid, linear, radial, glass, office glass, gel, and vista.
public override GradientStyles GradientStyle { get; set; }
Overrides:
Gets or sets the color of the horizontal line when ShowHorizontalLine is enabled.
[TypeConverter(typeof(RadColorEditorConverter))]
public virtual Color HorizontalLineColor { get; set; }
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.
public virtual int HorizontalLineWidth { get; set; }
Gets or sets the main image displayed on the element. The image position is controlled by ImageAlignment and TextImageRelation properties.
[TypeConverter(typeof(ImageTypeConverter))]
public virtual Image Image { get; set; }
Implements:
Gets or sets the alignment of the image within the element bounds, controlling both horizontal and vertical positioning.
public virtual ContentAlignment ImageAlignment { get; set; }
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".
[Browsable(false)]
public virtual ImageDrawType ImageDrawType { get; set; }
Gets or sets the index of the image from the associated to display on this element.
[RelatedImageList("ElementTree.Control.ImageList")]
[TypeConverter("Telerik.WinControls.UI.Design.NoneExcludedImageIndexConverter, Telerik.WinControls.UI.Design, Version=2026.3.1026.48, Culture=neutral, PublicKeyToken=5bb2a467cbec794e")]
public virtual int ImageIndex { get; set; }
Implements:
Gets or sets the key of the image from the associated to display on this element.
[TypeConverter("Telerik.WinControls.UI.Design.RadImageKeyConverter, Telerik.WinControls.UI.Design, Version=2026.3.1026.48, Culture=neutral, PublicKeyToken=5bb2a467cbec794e")]
public virtual string ImageKey { get; set; }
Implements:
Gets or sets the layout mode for the main image, determining how it is positioned and scaled within the element bounds.
public virtual ImageLayout ImageLayout { get; set; }
Gets or sets the opacity level for image rendering, where 1.0 represents fully opaque and 0.0 represents fully transparent.
public virtual double ImageOpacity { get; set; }
Gets or sets the color that will be treated as transparent when rendering images on this element.
[TypeConverter(typeof(RadColorEditorConverter))]
public Color ImageTransparentColor { get; set; }
Gets the layout manager that controls the positioning and sizing of text and image content within this element.
public virtual LayoutManagerPart Layout { get; }
Gets or sets a value indicating whether trailing spaces in text should be included in text measurement calculations.
[Browsable(false)]
public bool MeasureTrailingSpaces { get; set; }
Implements:
Gets or sets the number of colors used in gradient background effects. This determines how many color properties are utilized.
public override int NumberOfColors { get; set; }
Overrides:
Gets or sets a value indicating whether the element should be painted.
public override bool ShouldPaint { get; set; }
Overrides:
Children visibility is not be affected.
Gets or sets a value indicating whether a horizontal line should be rendered across the element.
public virtual bool ShowHorizontalLine { get; set; }
Gets or sets a value indicating whether keyboard access cues (underlines for mnemonics) should be displayed for this element.
[Browsable(false)]
public virtual bool ShowKeyboardCues { get; set; }
Implements:
Gets or sets the SVG image to be displayed on this element as a scalable vector graphic.
public virtual RadSvgImage SvgImage { get; set; }
Gets or sets the alignment of text within the element bounds, controlling both horizontal and vertical positioning.
public virtual ContentAlignment TextAlignment { get; set; }
Implements:
Gets or sets the spatial relationship between text and image content. This determines how text and image are positioned relative to each other.
public TextImageRelation TextImageRelation { get; set; }
Gets the text formatting and measurement settings assembled from this element's current text-related properties.
public TextParams TextParams { get; }
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.
public virtual TextRenderingHint TextRenderingHint { get; set; }
Gets or sets a value indicating whether text will automatically wrap to multiple lines when it exceeds the element's width.
public virtual bool TextWrap { get; set; }
Implements:
Gets or sets a value indicating whether ampersand characters (&) in text will be treated as mnemonic access key indicators.
public virtual bool UseMnemonic { get; set; }
Implements:
Methods
Starts animation for an animated main or background image, registering its frame-change callback only once while that image is active in the given role.
Arranges a single child element according to its fit-to-size mode within the allocated space.
protected virtual void ArrangeElement(RadElement element, SizeF finalSize)
The child element to arrange.
finalSizeSizeFThe final size available for arranging the element.
Arranges the content and child elements within the final allocated space, positioning text, images, and child elements.
Calculates the final desired size by combining the element's content size with child elements' size requirements.
protected virtual SizeF CalculateDesiredSize(SizeF availableSize, SizeF desiredSize, SizeF elementsDesiredSize)
The available space that a parent element can allocate.
desiredSizeSizeFThe desired size calculated from content and layout requirements.
elementsDesiredSizeSizeFThe desired size calculated from child elements.
Returns:The final desired size taking into account all size constraints.
Clips an image to fit within the specified rectangle and size constraints, creating a new image if necessary.
protected virtual Image ClipImage(Image image, Rectangle imageRectange, Size size)
The source image to clip.
imageRectangeRectangleThe rectangle defining the clipping area within the source image.
sizeSizeThe target size for the clipped image.
Returns:The clipped image, or the original image if no clipping is needed.
Creates the text settings used by text measurement and painting from the element's current properties. Override to customize those settings for a derived element.
protected virtual TextParams CreateTextParams()
A snapshot of the element's text, formatting, and rendering settings.
Disposes of managed resources including cached images and SVG images when the element is being disposed.
protected override void DisposeManagedResources()
Overrides:
Draws a horizontal line across the element when text is present, positioning the line based on text alignment and size.
protected virtual void DrawHorizontalLine(IGraphics graphics)
The graphics context used for rendering the horizontal line.
Draws a horizontal line across the element when no text is present and ShowHorizontalLine is enabled.
protected virtual void DrawHorizontalLineWithoutText(IGraphics graphics)
The graphics context used for rendering the horizontal line.
Creates a bitmap snapshot of the element, using anti-aliased text while rendering when backColor is transparent.
After a successful render, restores the original TextRenderingHint.
public override Bitmap GetAsBitmapEx(Color backColor, float totalAngle, SizeF totalScale)
The background color to use for the snapshot.
totalAnglefloatThe rotation angle applied while rendering.
totalScaleSizeFThe scale applied while rendering.
Returns:The rendered bitmap, or null if the element is not loaded or has no positive size.
Overrides:
Gets the border thickness for this element instance by delegating to the static GetBorderThickness(LightVisualElement, bool) method.
protected virtual Padding GetBorderThickness(bool checkDrawBorder)
When true, returns zero thickness if DrawBorder is false.
Returns:A Padding structure representing the border thickness.
Calculates the border thickness for a LightVisualElement based on its border configuration and drawing state.
public static Padding GetBorderThickness(LightVisualElement element, bool checkDrawBorder)
The LightVisualElement instance to calculate border thickness for.
checkDrawBorderboolWhen 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.
Calculates the client area offset by combining padding and optionally border thickness.
Calculates the client rectangle area available for content within the element bounds, optionally including border space.
protected virtual RectangleF GetClientRectangle(bool includeBorder, SizeF finalSize)
When true, accounts for border thickness in the client rectangle calculation.
finalSizeSizeFThe total size of the element from which to calculate the client rectangle.
Returns:A RectangleF representing the available client area for content.
Calculates the content rectangle after subtracting padding and, when DrawBorder is true, border thickness. The returned width and height are never negative.
protected override RectangleF GetClientRectangle(SizeF finalSize)
The total size available to the element.
Returns:The remaining rectangle available for content.
Overrides:
Calculates the clipping rectangle for this element, taking into account border thickness and padding.
protected override RectangleF GetClipRect()
A RectangleF representing the clipping bounds for content rendering.
Overrides:
Returns the element's text face rectangle from the local origin, sized to its desired size.
public RectangleF GetFaceRectangle()
The text face bounds in the element's local coordinates.
Implements:
Returns the explicitly assigned image draw type, or null when image selection is automatic.
protected ImageDrawType? GetImageDrawTypeLocalValue()
The assigned ImageDrawType value, or null if no explicit value was set.
Returns this element's BorderWidth for painting instead of inheriting the parent's border thickness.
public override float GetPaintingBorderWidth()
The uniform border width configured on this element.
Overrides:
Creates the filter used to expose this element's declared properties together with appearance, behavior, and layout properties to styling operations.
public override Filter GetStylablePropertiesFilter()
A combined filter for the properties that can be styled on this element.
Overrides:
Gets TextAlignment adjusted for the element's RightToLeft setting.
protected ContentAlignment GetTextAlignment()
The effective text alignment used by layout and painting.
Mirrors left and right alignment values when RightToLeft is enabled.
protected ContentAlignment GetTextAlignment(ContentAlignment textAlignment)
The alignment to adjust.
Returns:The adjusted alignment, or the original value when right-to-left layout is disabled.
Calculates the size required to display the text content within the proposed size constraints.
public SizeF GetTextSize(SizeF proposedSize, TextParams textParams)
The proposed size constraints for the text measurement.
textParamsTextParamsThe text parameters containing formatting and display options.
Returns:A SizeF representing the calculated text size.
Implements:
Calculates the size required to display the text content using the specified text parameters.
public SizeF GetTextSize(TextParams textParams)
The text parameters containing formatting and display options.
Returns:A SizeF representing the calculated text size.
Implements:
Initializes the internal fields and components of the LightVisualElement. This method sets up text primitives, image primitives, and layout management components.
protected override void InitializeFields()
Overrides:
Maps fill, border, and image primitive properties to the corresponding properties on this element. A border setting also maps the primitive foreground color to BorderColor.
public override RadProperty MapStyleProperty(RadProperty propertyToMap, string settingType)
The primitive property referenced by the style.
settingTypestringThe style setting category; Border selects border-specific property mapping.
The corresponding property on this element, or null when no mapping exists.
Overrides:
Measures all child elements when auto-sizing is enabled, calculating the space required for child elements.
protected virtual SizeF MeasureElements(SizeF availableSize, SizeF clientSize, Padding borderThickness)
The available space that a parent element can allocate.
clientSizeSizeFThe client area size available for content.
borderThicknessPaddingThe thickness of the border that affects available space.
Returns:The desired size needed to accommodate all child elements.
Measures the desired size of the text content given the available space and text parameters.
public SizeF MeasureOverride(SizeF availableSize, TextParams textParams)
The available space for measuring the text content.
textParamsTextParamsThe text parameters containing formatting and display options.
Returns:A SizeF representing the desired size of the text content.
Implements:
Measures the desired size of the element by calculating the space needed for content, padding, and borders.
Called when animated image frame changes.
protected virtual void OnAnimatedImageFrameChanged()
Handles state changes for bit flags, particularly managing text primitive implementation when HTML rendering is disabled.
Resolves the selected image-list image after loading and invalidates measurement when an image list is assigned.
protected override void OnLoaded()
Overrides:
Forwards pointer movement to the active text primitive when HTML rendering is enabled, allowing its text block to update link interaction state.
protected override void OnMouseMove(MouseEventArgs e)
The mouse event data.
Overrides:
Handles mouse movement events for the text primitive, enabling text interaction features.
public void OnMouseMove(object sender, MouseEventArgs e)
The source of the mouse move event.
eMouseEventArgsThe MouseEventArgs containing event data.
Implements:
Updates text rendering, image caches, and layout state when relevant visual properties change. Image-list index or key changes also refresh the image and invalidate measurement.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Overrides:
Refreshes the cached image and invalidates measurement when the root reports an image-list change.
protected override void OnTunnelEvent(RadElement sender, RoutedEventArgs args)
Overrides:
Renders the background image of the element according to the specified BackgroundImageLayout setting.
protected virtual void PaintBackgroundImage(IGraphics graphics)
The graphics context used for rendering the background image.
Orchestrates the painting of all content elements including background image, main image or SVG image, and text.
protected virtual void PaintContent(IGraphics graphics)
The graphics context used for rendering content.
Performs the main painting operation for the element, rendering fill, content, and border in the correct order.
Renders the main image of the element, handling image animation and thread-safe access to the cached image.
protected virtual void PaintImage(IGraphics graphics)
The graphics context used for rendering the image.
Paints the text primitive with the specified graphics context, transformation, and text parameters.
public void PaintPrimitive(IGraphics graphics, float angle, SizeF scale, TextParams textParams)
The graphics context used for painting.
anglefloatThe rotation angle to apply during painting.
scaleSizeFThe scale factor to apply during painting.
textParamsTextParamsThe text parameters containing formatting and display options.
Implements:
Paints the text primitive with the specified graphics context and text parameters.
public void PaintPrimitive(IGraphics graphics, TextParams textParams)
The graphics context used for painting.
textParamsTextParamsThe text parameters containing formatting and display options.
Implements:
Renders the text content of the element, including horizontal line effects when enabled.
protected virtual void PaintText(IGraphics graphics)
The graphics context used for rendering text.
Paints the active text primitive using the element's text parameters and current transforms.
protected void PaintTextCore(IGraphics graphics)
The graphics context used for painting.
Serializes SvgImageXml only when an SVG image exists and is stored locally or through a local binding; other properties use the base serialization decision.
public override bool? ShouldSerializeProperty(PropertyDescriptor property)
The property descriptor to evaluate.
Returns:bool?
The serialization decision for SvgImageXml, or the base class decision for other properties.
Overrides:
Toggles the text primitive when text related properties are change.
protected virtual void ToggleTextPrimitive(RadProperty property)
The changed property.