Up until now I have had one and only one Document in the DocumentItems collection. My MainWindow view is simply a Ribbon, DockSite, and a StatusBar. The DockSite is defined like the following.
<docking:DockSite DocumentItemsSource={Binding DocumentItems”}
DocumentItemContainerStyle=”{StaticResource DocumentItemStyle}”
ToolItemsSource=”{Binding ToolItems}”
ToolItemContainerStyle=”{StaticResource ToolItemStyle}”
<docking:SplitContainer>
<docking:Workspace>
<docking:TabbedMdiHost />
</docking:Workspace>
</docking:SplitContainer>
</docking:DockSite>
Now I am trying to add multiple documents of two different types. I have two ViewModels, say MainDocumentViewModel and SecondaryDocumentViewModel both inherit from DocumentWindowViewModel which contains all of the properties like IsOpen, CanClose, etc. The MainDocumentViewModel gets created at startup and added to the DocumentItems collection and the SecondaryDocumentViewModel(s) get created upon user request (clicking a button).
When a SecondaryDocumentViewModel gets created I do not want it to be docked with the MainDocumentViewModel by default. I would like it to be docked below the MainDocumentViewModel. I believe this is called a Vertical Container? I know how to configure a ToolWindow to be docked right, left, bottom but how can I configure my SecondaryDocumentViewModel to dock below the main document if it’s the first secondary document and if there already a secondary document then the next secondary document will dock on top of the previous secondary document. I believe I can achieve the second part of this by using the WindowsGroupName. All my secondary document have the name WindowsGroupName but how to I get it setup the first time a secondary document is added?
Thanks,
-eric