How do you add a WPF component to AvalonDock

2.1k Views Asked by At

I have created a WPF UserControl called ChartPanel to my .NET 4.0. I am using AvalonDock as my docking library. I have the following WPF code for the MainWindow:

        <ad:DockingManager x:Name="dockManager" Grid.Row="1">
            <ad:ResizingPanel Orientation="Horizontal">
                <ad:DockablePane>
                    <ad:DockableContent x:Name="fileFrame" Title="File List">
                        <TreeView Name="fileTree"/>                        
                    </ad:DockableContent>
                    <ad:DockableContent x:Name="viewFrame" Title="View List">
                        <TreeView Name="viewTree"/>
                    </ad:DockableContent>
                </ad:DockablePane>
                <ad:DocumentPane>
                    <ad:DocumentContent Name="dockContent"></ad:DocumentContent>

                </ad:DocumentPane>
            </ad:ResizingPanel>
        </ad:DockingManager>

How do I add my ChartPanel.xaml control to the DocumentPane or DocumentContent object? Note: I'm not sure which object I should be adding it to, the DocumentPane or DocumentContent.

1

There are 1 best solutions below

0
On BEST ANSWER

Basically like this, there is nothing complicated in it. The tag surrounding it will be either DockableContent or DocumentContent.

    <ad:DockingManager x:Name="dockManager" Grid.Row="1">
        <ad:ResizingPanel Orientation="Horizontal">
            <ad:DockablePane>
                <ad:DockableContent x:Name="fileFrame" Title="File List">
                    <TreeView Name="fileTree"/>                        
                </ad:DockableContent>
                <ad:DockableContent x:Name="viewFrame" Title="View List">
                    <TreeView Name="viewTree"/>
                </ad:DockableContent>
            </ad:DockablePane>
            <ad:DocumentPane>
                <ad:DocumentContent Name="dockContent">
                     <yourNamespace:YourControl />                <----------HERE
                </ad:DocumentContent>

            </ad:DocumentPane>
        </ad:ResizingPanel>
    </ad:DockingManager>