Thanks for sharing this ...
I use prism regionManager.RequestNavigation to load the view and I implement the IConfirmNavigationRequest
in the VM and it was working fine before I move to RadDock; there I implement the confirmation to close with/out saving to the user and prism takes care of unloading the view VM .
I have found a work around in the VM, if you are interested;
foreach (var region in RegionManager.Regions)
foreach (var view in region.Views)
if (view is MyDetailsView)
if (((MyDetailsView)view).DataContext == this)
//if (region.Views.Contains(this)) region.Remove(this);
I admit its not generic but it does the work & my view is clean from any CodeBehind.
I am sure your viemodelmanager will be valuable to me, if you can share it as well, will be fabulous.
small detail I forgot to mention (but important) when using prism navigation, I had to have a default view opened before I actually navigate to any other real view (items data), I put a dummy xaml page with "select item to display its content" text message, this is how I trigger the navigation in prism (just in case)