Skip to main content

LayoutItem Class

Represents a control that consists of a label and content regions. The LayoutItem cannot be used outside a LayoutControl.

Namespace: DevExpress.Xpf.LayoutControl

Assembly: DevExpress.Xpf.LayoutControl.v14.2.dll

#Declaration

[TemplatePart(Name = "LabelElement", Type = typeof(LayoutItemLabel))]
[StyleTypedProperty(Property = "LabelStyle", StyleTargetType = typeof(LayoutItemLabel))]
[DXToolboxBrowsable(DXToolboxItemKind.Free)]
public class LayoutItem :
    ControlBase,
    ILayoutControlCustomizableItem

#Remarks

Visually a LayoutItem consists of a label and content regions. The following image shows a LayoutItem with a label set to "Home phone:" and content set to a TextBox:

LayoutItem

You can provide a label via the LayoutItem.Label property. Typically, you assign a text string to this property. However, you can assign any object to the LayoutItem.Label property, and then specify a data template (via the LayoutItem.LabelTemplate property) that will define how the label is rendered on-screen. A label's style can be customized via the LayoutItem.LabelStyle property. To change the label's position, use the LayoutItem.LabelPosition property.

A layout item's content can be specified via the LayoutItem.Content property. When declaring a LayoutItem object in XAML, any object defined between the LayoutItem start and end tags is used to initialize the LayoutItem.Content property.

Typically, LayoutItem objects are used as elements of a LayoutControl. When they are used within a LayoutControl, the content regions of the LayoutItems are automatically aligned:

CD_LayoutIterms

See Aligning contents of LayoutItems to learn more.

#Examples

The following image shows the result:

LayoutControl_Ex

See Also