2011-01-31 37 views
1

我已經創建了一個名爲ChartPanel的WPF UserControl到我的.NET 4.0。我使用AvalonDock作爲我的對接庫。我對主窗口下面的代碼WPF:如何添加一個WPF組件到AvalonDock

 <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> 

如何添加我ChartPanel.xaml控制到DocumentPane或DocumentContent對象?注意:我不知道應該將哪個對象添加到DocumentPane或DocumentContent中。

回答

2

基本上這樣,沒有什麼複雜的。它周圍的標籤將是DockableContent或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> 
相關問題