0

I am currently working with avalon dock v2, in the template of my document sources, i'm also putting in a docking manager.

Yes for each of my document, I want anchorable panes inside it. But when I try to do that, it doesn't work, it just shows the toString of the docking manager for each of the document, is there a way to fix that.

Also, how do i default dock my anchorable?

Thanks and Regards, Kev84

Kev84
  • 827
  • 3
  • 15
  • 26

1 Answers1

1

In creating a template for the AvalonDock's LayoutDocument (via the LayoutDocumentControl) I also came across a similar issue. The solution was to set the ContentSource of the ContentPresenter to point to the Model property of my control. The code below illustrates it:

<!--The LayoutDocument is templated via the LayoutDocumentControl-->
        <Style TargetType="{x:Type ad:LayoutDocumentControl}">
            <Style.Setters>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ad:LayoutDocumentControl}">
                            <ScrollViewer
                                        Background="AliceBlue"
                                        HorizontalScrollBarVisibility="Auto"  VerticalScrollBarVisibility="Auto" SnapsToDevicePixels="True">
                                <!--Make sure that the ContentSource points the Model Property of the Control-->
                                <ContentPresenter
                                        Content="{Binding Path=Content, UpdateSourceTrigger=PropertyChanged}"
                                        ContentSource="{Binding Path=Model, UpdateSourceTrigger=PropertyChanged}"
                                        />
                            </ScrollViewer>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style.Setters>
        </Style> 

A similar approach should apply to your case. This is just a temptative answer (since I am also new to AvalonDock 2.0), but it may be worth trying.

Live long and prosper!

N'zamba
  • 186
  • 1
  • 7