AutoHideGroup.SizeToContent Attached Property
Gets or sets whether an auto-hide panel should be resized according to its content. This is an attached property.
Namespace: DevExpress.Xpf.Docking
Assembly: DevExpress.Xpf.Docking.v24.1.dll
NuGet Package: DevExpress.Wpf.Docking
Declaration
Returns
Type | Description |
---|---|
SizeToContent | A SizeToContent enumerator value that specifies whether an auto-hide panel should be resized according to its content. This is an attached property. |
Remarks
A LayoutPanel within an auto-hide group can adapt to its content. You can stretch the panel vertically, horizontally, or in both directions to fit the size of the content within it.
When the SizeToContent property is set to Manual, the layout panel will not be scaled and will use its BaseLayoutItem.ItemWidth and BaseLayoutItem.ItemHeight property values.
Use the AutoHideGroup.GetSizeToContent and AutoHideGroup.SetSizeToContent methods to get or set the SizeToContent property in code-behind.
The following code sample sets the Solution Explorer and Properties LayoutPanels’ SizeToContent property to Width and Height .
<Window ...
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking">
<dxdo:DockLayoutManager>
<dxdo:LayoutGroup x:Name="LayoutRoot" Orientation="Vertical">
<dxdo:LayoutGroup >
<dxdo:LayoutPanel Caption="Toolbox"/>
<dxdo:DocumentGroup>
<dxdo:DocumentPanel Caption="Document1">
</dxdo:DocumentPanel>
<dxdo:DocumentPanel Caption="Document2" />
</dxdo:DocumentGroup>
</dxdo:LayoutGroup>
</dxdo:LayoutGroup>
<dxdo:DockLayoutManager.AutoHideGroups>
<dxdo:AutoHideGroup>
<dxdo:LayoutPanel dxdo:AutoHideGroup.SizeToContent="Width" Caption="Solution Explorer">
<Button Width="450" />
</dxdo:LayoutPanel>
<dxdo:LayoutPanel dxdo:AutoHideGroup.SizeToContent="Height" Caption="Properties">
<Button Height="150" />
</dxdo:LayoutPanel>
</dxdo:AutoHideGroup>
</dxdo:DockLayoutManager.AutoHideGroups>
</dxdo:DockLayoutManager>
</Window>