AvalonDock 2.0 increasing grip size

612 views Asked by At

Is there any way to increase the grip (or gridsplitter) size in AvalonDock 2.0? I find it hard to resize the docks, since I have to place the cursor in the exact pixel where the border of the dock (or anchorable pane) is.

EDIT: I would also like to keep the visual size as it is now, but make it easier to resize the panes.

Thanks in advance!

2

There are 2 answers

0
IamJose On

When defining the docking container you can set the width as follows:

<xcad:DockingManager x:Name="dockManager" AnchorablesSource="{Binding Anchorables}" GridSplitterWidth="10">

Hope it helps.

0
Joe On

For anyone who stumbles upon this question like I did.

IamJose's answer didn't work for me. However, as Filippo Vigani noted, you need to set a negative margin (why? Who knows!).

I wanted a grid splitter width of 5. And this worked for me:

   <avalonDock:DockingManager
                    AnchorablesSource="{Binding Tools}" 
                    DocumentsSource="{Binding Documents}"
                    AllowMixedOrientation="True"
                    GridSplitterWidth="10"
                    GridSplitterHeight="10">
            <avalonDock:DockingManager.Theme>
                <avalonDock:MetroTheme />
            </avalonDock:DockingManager.Theme>
            <avalonDock:DockingManager.LayoutUpdateStrategy>
                <helpers:LayoutUpdateStrategy />
            </avalonDock:DockingManager.LayoutUpdateStrategy>
            <!--<avalonDock:DockingManager.LayoutItemContainerStyle>
            <Style TargetType="{x:Type avalonDock:LayoutItem}">
                <Setter Property="Title" Value="{Binding Model.Title}" />
            </Style>
        </avalonDock:DockingManager.LayoutItemContainerStyle>-->
            <avalonDock:DockingManager.LayoutItemContainerStyleSelector>
                <helpers:AutobinderLayoutSelector>
                    <helpers:AutobinderLayoutSelector.DocumentStyle>
                        <Style TargetType="{x:Type avalonDock:LayoutItem}">
                            <Setter Property="Title" Value="{Binding Model.Title}" />
                            <Setter Property="Margin" Value="-5" />
                        </Style>
                    </helpers:AutobinderLayoutSelector.DocumentStyle>
                    <helpers:AutobinderLayoutSelector.ToolStyle>
                        <Style TargetType="{x:Type avalonDock:LayoutItem}">
                            <Setter Property="Title" Value="{Binding Model.Title}" />
                            <Setter Property="Margin" Value="-5" />
                            <!--<Setter Property="Visibility" Value="{Binding Model.IsVisible, Mode=TwoWay, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter={x:Static Visibility.Hidden}}"/>
                        <Setter Property="ContentId" Value="{Binding Model.ContentId}"/>
                        <Setter Property="IsSelected" Value="{Binding Model.IsSelected, Mode=TwoWay}"/>-->
                        </Style>
                        ...

So a -5 negative margin on the documents/tools and a grid splitter width and height of 10.