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
public ImageAndTextLayoutPanel()
Fields
public static RadProperty DisplayStyleProperty
public static RadProperty ImageAlignmentProperty
public static RadProperty IsImagePrimitiveProperty
public static RadProperty IsTextPrimitiveProperty
public static RadProperty TextAlignmentProperty
public static RadProperty TextImageRelationProperty
Properties
Gets or sets which elements should be displayed in the layout panel.
public DisplayStyle DisplayStyle { get; set; }
A DisplayStyle value that determines which elements are visible. The default value is ImageAndText.
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.
Gets or sets the alignment of the image element within its allocated space.
public ContentAlignment ImageAlignment { get; set; }
A ContentAlignment value that specifies where the image should be positioned. The default value is MiddleLeft.
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.
Gets or sets the alignment of the text element within its allocated space.
public ContentAlignment TextAlignment { get; set; }
A ContentAlignment value that specifies where the text should be positioned. The default value is MiddleLeft.
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.
Gets or sets the spatial relationship between the image and text elements.
public TextImageRelation TextImageRelation { get; set; }
A TextImageRelation value that specifies how the image and text should be positioned relative to each other. The default value is Overlay.
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
Arranges the RadElement to its final location. The element must call the Arrange method of each of its children.
protected override SizeF ArrangeOverride(SizeF 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:
In this method call to the Arrange method of each child must be made.
Releases managed resources by clearing the property store and disposing value animators to prevent memory leaks.
protected override void DisposeManagedResources()
Overrides:
Measures the space required by the RadElement
Used by the layout system.
protected override SizeF MeasureOverride(SizeF 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:
In this method call to the Measure method of each child must be made.
protected override void OnChildrenChanged(RadElement child, ItemsChangeOperation changeOperation)
Overrides:
Called when the element has been successfully loaded. That includes loading of all its children as well.
protected override void OnLoaded()
Overrides:
Raises the RadPropertyChanged event and the standard .NET PropertyChanged event to notify subscribers of property value changes.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
The RadPropertyChangedEventArgs containing information about the property change.
Overrides: