Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avalondock how to set tab width of LayoutDocument

The tabs that show up for LayoutDocument have short titles, like AA,AB,AC. Consequently, their tab sizes are relatively small.

Is there a way to manually set a fixed width for the tabs?

    <avalonDock:DockingManager x:Name="DockManager" AllowMixedOrientation="True">
        <avalonDock:DockingManager.Theme>
            <themes:AeroTheme/>
        </avalonDock:DockingManager.Theme>

        <avalonDock:LayoutRoot>                    
            <avalonDock:LayoutPanel Orientation="Horizontal">
                <avalonDock:LayoutDocumentPaneGroup>
                    <avalonDock:LayoutDocumentPane >
                        <avalonDock:LayoutDocument Title="AA" CanClose="False" >
                            <my:LGDCSimulator/>
                        </avalonDock:LayoutDocument>
                        <avalonDock:LayoutDocument Title="AB" CanClose="False">
                            <my:OtherCompanyDCSimulator/>
                        </avalonDock:LayoutDocument>
                    </avalonDock:LayoutDocumentPane>
                </avalonDock:LayoutDocumentPaneGroup>
            </avalonDock:LayoutPanel>
        </avalonDock:LayoutRoot>
    </avalonDock:DockingManager>

enter image description here

like image 960
l46kok Avatar asked Dec 07 '25 09:12

l46kok


1 Answers

You can set width globally for all LayoutDocument in DockingManager resources:

<avalonDock:DockingManager x:Name="DockManager" AllowMixedOrientation="True">
    <avalonDock:DockingManager.Resources>
        <Style TargetType="{x:Type avalonDock:LayoutDocumentTabItem}">
            <Setter Property="Width" Value="120" />                   
        </Style>
    </avalonDock:DockingManager.Resources>
    <avalonDock:DockingManager.Theme>
        <avalonDock:AeroTheme/>
    </avalonDock:DockingManager.Theme>
    ...
like image 136
kmatyaszek Avatar answered Dec 09 '25 21:12

kmatyaszek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!