BaseLayoutItem.AllowHide Property
Gets or sets whether the item can be hidden (auto-hidden, for dock items). This is a dependency property.
Namespace: DevExpress.Xpf.Docking
Assembly: DevExpress.Xpf.Docking.v24.2.dll
NuGet Package: DevExpress.Wpf.Docking
Declaration
Property Value
Type | Description |
---|---|
Boolean | true, if the item can be hidden (auto-hidden, for dock items); otherwise, false. |
Remarks
Hide Dock Items
In Xaml
Create an AutoHideGroup, add a panel to the group, and then add the group to the DockLayoutManager.AutoHideGroups collection.
<Window ...
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking">
<dxdo:DockLayoutManager>
<dxdo:DockLayoutManager.AutoHideGroups>
<dxdo:AutoHideGroup DockType="Right" AllowHide="True">
<dxdo:LayoutPanel Caption="Panel1"/>
</dxdo:AutoHideGroup>
</dxdo:DockLayoutManager.AutoHideGroups>
</dxdo:DockLayoutManager>
</Window>
In Code Behind
Use the DockController‘s IDockController.Hide methods to auto-hide a specific dock item.
Hide Layout Items
Use the DockLayoutManager.LayoutController object’s LayoutController.Hide method to hide Layout items.
Panel’s Data Context
When you set the LayoutPanel‘s AutoHide property to true
, the LayoutPanel DataContext can be changed, because the panel is placed inside a new AutoHideGroup.
Subscribe to the LayoutPanel’s DataContextChanging event to catch the moment when the panel’s DataContext is changed.
When this occurs, you can specify your own DataContext for the panel. Subscribe to the DockManager.DockOperationCompleted event to catch the moment when your panel is hidden, and specify your own DataContext.
The following code sample changes ContentPanel LayoutPanel‘s DataContext when the panel is hidden:
private void dockManager_DockOperationCompleted(object sender, DevExpress.Xpf.Docking.Base.DockOperationCompletedEventArgs e) {
if(e.Item.Name == "ContentPanel" && e.DockOperation == DockOperation.Hide ) {
e.Item.DataContext = YourDataContext;
}
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the AllowHide property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.