Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.v24.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