We have a Region in the Window tag of our shell, adding things to this region pops out another Window.
<Window x:Class="GTS.GRS.N3.Shell.Shell1"
--removed namespace references for clarity
cal:RegionManager.RegionName="{x:Static Constants:RegionNames.WindowRegion}">
We're adding ViewModels to the Region Manager and then the View is attached via a data context so that the ViewModel knows nothing about the View i.e.
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<DataTemplate DataType="{x:Type Model:CommunicationViewModel}">
<v:CommunicationView />
</DataTemplate>
</ResourceDictionary>
My question is how do I close the Pop up Window, I tried removing the ViewModel from the RegionManager - but this exceptions ... the View is a UserControl, but I need to close its Owner which is a new Window opened by the Region. I don't really want to have to hack it via the DataContext of the ViewModel.
Can anyone assist please?