Hi,
We are using the mvvm approach with the dock site. We make a binding on DocumentItemsSource to a DeferrableObservableCollection in the view model of the main window.
Then in the constructor of the window, we take a handler on the CollectionChanged to be notified of any activity in the collection.
When we hit the [x] button on the DocumentWindow, the window disappears but the collection is never modified.
Why? Is the DocumentWindow only deactivated? How to close the document window and make sure it's destroyed?
Thanks.
Martin
Here is the dock site xaml code of the window:
<docking:DockSite x:Name="dockSite"
Loaded="dockSite_Loaded"
WindowRegistered="dockSite_WindowRegistered"
WindowUnregistered="dockSite_WindowUnregistered"
AreDocumentWindowsDestroyedOnClose="True"
themes:ThemeManager.Theme="{Binding ElementName=window, Path=(themes:ThemeManager.Theme)}"
DocumentItemsSource="{Binding Projects, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
DocumentItemContainerStyle="{StaticResource DocumentItemStyle}"
>
<docking:DockSite.Resources>
<DataTemplate DataType="{x:Type projVM:ProjectInstanceViewModel}" >
<projView:ProjectInstanceView />
</DataTemplate>
</docking:DockSite.Resources>
<docking:SplitContainer Orientation="Horizontal">
<docking:Workspace >
<docking:TabbedMdiHost x:Name="tabbedMdiHost" IsCloseButtonOnTab="True" CanDocumentsCloseOnMiddleClick="True"/>
</docking:Workspace>
<docking:ToolWindowContainer Width="300" >
<docking:ToolWindow Title="Properties" CanClose="False" x:Name="PropertiesPnl">
<!-- Property View -->
<ContentControl Name="PropertiesInterface"
prism:RegionManager.RegionName="{x:Static inf:RegionNames.PropertiesRegion}" />
</docking:ToolWindow>
</docking:ToolWindowContainer>
</docking:SplitContainer>
</docking:DockSite>