ClassImageAndTextLayoutPanel
Represents a specialized layout panel that arranges two child elements (an image element and a text element) with configurable positioning and alignment.
Definition
Namespace:Telerik.WinControls.Layouts
Assembly:Telerik.WinControls.dll
Syntax:
public class ImageAndTextLayoutPanel : LayoutPanel, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode
Inheritance: objectDisposableObjectRadObjectRadElementLayoutPanelImageAndTextLayoutPanel
Derived Classes:
Implements:
Inherited Members
Constructors
ImageAndTextLayoutPanel()
Declaration
public ImageAndTextLayoutPanel()
Fields
DisplayStyleProperty
Declaration
public static RadProperty DisplayStyleProperty
Field Value
ImageAlignmentProperty
Declaration
public static RadProperty ImageAlignmentProperty
Field Value
IsImagePrimitiveProperty
Declaration
public static RadProperty IsImagePrimitiveProperty
Field Value
IsTextPrimitiveProperty
Declaration
public static RadProperty IsTextPrimitiveProperty
Field Value
TextAlignmentProperty
Declaration
public static RadProperty TextAlignmentProperty
Field Value
TextImageRelationProperty
Declaration
public static RadProperty TextImageRelationProperty
Field Value
Properties
DisplayStyle
Gets or sets which elements should be displayed in the layout panel.
Declaration
public DisplayStyle DisplayStyle { get; set; }
Property Value
A DisplayStyle value that determines which elements are visible. The default value is ImageAndText.
Remarks
This property controls the visibility of the image and text elements:
- None: Neither image nor text is displayed
- Image: Only the image element is displayed
- Text: Only the text element is displayed
- ImageAndText: Both image and text elements are displayed
The layout calculations automatically adjust based on which elements are visible.
ImageAlignment
Gets or sets the alignment of the image element within its allocated space.
Declaration
public ContentAlignment ImageAlignment { get; set; }
Property Value
A ContentAlignment value that specifies where the image should be positioned. The default value is MiddleLeft.
Remarks
This property determines how the image element is positioned within the space allocated to it by the layout calculation. The alignment is relative to the image's designated area, not the entire panel.
TextAlignment
Gets or sets the alignment of the text element within its allocated space.
Declaration
public ContentAlignment TextAlignment { get; set; }
Property Value
A ContentAlignment value that specifies where the text should be positioned. The default value is MiddleLeft.
Remarks
This property determines how the text element is positioned within the space allocated to it by the layout calculation. The alignment is relative to the text's designated area, not the entire panel.
TextImageRelation
Gets or sets the spatial relationship between the image and text elements.
Declaration
public TextImageRelation TextImageRelation { get; set; }
Property Value
A TextImageRelation value that specifies how the image and text should be positioned relative to each other. The default value is Overlay.
Remarks
This property controls the fundamental layout relationship between the image and text elements:
- ImageAboveText: Image is positioned above the text
- ImageBeforeText: Image is positioned to the left of the text
- TextAboveImage: Text is positioned above the image
- TextBeforeImage: Text is positioned to the left of the image
- Overlay: Image and text overlap in the same space
Methods
ArrangeOverride(SizeF)
Arranges the RadElement to its final location. The element must call the Arrange method of each of its children.
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
finalSize
The size that is available for element.
Returns
The rectangle occupied by the element. Usually finalSize. Should you return different size, the Layout system will restart measuring and rearranging the items. That could lead to infinite recursion.
Overrides
Remarks
In this method call to the Arrange method of each child must be made.
DisposeManagedResources()
Releases managed resources by clearing the property store and disposing value animators to prevent memory leaks.
Declaration
protected override void DisposeManagedResources()
Overrides
MeasureOverride(SizeF)
Measures the space required by the RadElement
Used by the layout system.
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
availableSize
The size that is available to the RadElement. The available size can be infinity (to take the full size of the element)
Returns
The minimum size required by the element to be completely visible. Cannot be infinity.
Overrides
Remarks
In this method call to the Measure method of each child must be made.
OnChildrenChanged(RadElement, ItemsChangeOperation)
Declaration
protected override void OnChildrenChanged(RadElement child, ItemsChangeOperation changeOperation)
Parameters
child
changeOperation
Overrides
OnLoaded()
Called when the element has been successfully loaded. That includes loading of all its children as well.
Declaration
protected override void OnLoaded()
Overrides
OnPropertyChanged(RadPropertyChangedEventArgs)
Raises the RadPropertyChanged event and the standard .NET PropertyChanged event to notify subscribers of property value changes.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
e
The RadPropertyChangedEventArgs containing information about the property change.
Overrides