ItemTemplate for ToolWindowContainer

Docking/MDI for WPF Forum

Posted 13 years ago by Stephen Tapper
Avatar
I'm trying to dynamically create some tool windows based on an xml file. So I figured I would create an ItemTemplate for a ToolWindowContianer and bind the model objects to the ItemsSource property on the container. However, when I try to set the ItemsSource, I get an exception that says I can't add my type as an item of the DockingWindowContainer.

This is the xaml for my template

<docking:ToolWindowContainer Name="templatedToolContainer">
    <docking:ToolWindowContainer.ItemTemplate>
       <DataTemplate>
          <docking:ToolWindow>
             <TextBlock>
                ...
             </TextBlock>
          </docking:ToolWindow>
       </DataTemplate>
   </docking:ToolWindowContainer.ItemTemplate>
</docking:ToolWindowContainer>
Is there a way to do what I'm trying to do?

Comments (1)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Stephen,

Binding to the ItemsSource of a ToolWindowContainer is not supported. ToolWindowContainer, along with SplitContainer and TabbedMdiContainer, are dynamically created and destroyed as windows are moved around the DockSite. If you were to use ItemsSource on ToolWindowContainer, then we wouldn't be able to move the ToolWindows.

You can use the DockSite.ToolItemsSource and associated properties to create ToolWindows from items though. The MVVM demos in our Sample Browser show how this is used, as well as the separate Prism sample.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.