Skip to main content

DockLayoutManager.LayoutItem Attached Property

Gets or sets a BaseLayoutItem object to which a visual element belongs. This is an attached property.

Namespace: DevExpress.Xpf.Docking

Assembly: DevExpress.Xpf.Docking.v23.2.dll

NuGet Package: DevExpress.Wpf.Docking

Declaration

Returns

Type Description
BaseLayoutItem

A BaseLayoutItem object to which a visual element belongs.

Remarks

Consider the following example. Assume that a Button control is positioned within a LayoutPanel. The task is to close the panel when the Button is clicked.

In the example, the Button.Click event is handled. In this event, the value of the LayoutItem attached property is obtained. This value identifies the LayoutPanel where the button is positioned. To close the panel, the DockControllerBase.Close method is called.

private void Button_Click(object sender, RoutedEventArgs e) {
    item = (BaseLayoutItem)DockLayoutManager.GetLayoutItem(sender as Button);
    DockLayoutManager1.DockController.Close(item);
}
See Also