2012-07-17 68 views
0

我目前正在使用avalon dock v2,在我的文檔資源的模板中,我也在放置一個對接管理器。Avalon Dock v2佈局問題

是的,對於我的每一個文檔,我都希望在裏面有可錨定的窗格。但是,當我嘗試這樣做時,它不起作用,它只顯示每個文檔的對接管理器的toString,是否有解決該問題的方法。

另外,我如何默認碼頭我的可錨定?

感謝和問候, Kev84

回答

1

在開創了AvalonDock的LayoutDocument模板(通過LayoutDocumentControl)我也遇到了類似的問題。解決方案是將ContentPresenter的ContentSource設置爲指向我的控件的Model屬性。下面的代碼說明了這一點:

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

類似的方法應適用於您的情況。這只是一個答案(因爲我也是AvalonDock 2.0的新手),但它可能值得嘗試。

長壽而繁榮!