prism项目搭建 wpf_PRISM WPF-导航每次都会创建新视图

I'm using PRISM 4 Navigation API with Unity in WPF. I have a tree-view that initiates a RequestNavigate passing in the selected tree node's ID (GUID).

_regionManager.RequestNavigate(RegionNames.DetailRegion,

ViewNames.SiteView + "?ID=" + site.ID);

In my module, I have registered the view/view-model like so:

_container.RegisterType();

_container.RegisterType(ViewNames.SiteView);

When I select different nodes from the tree view, the DetailsRegion displays the SiteDetailsView as expected, but when I like to navigate back to the same node, a new view/view-model is created.

I tried to break at IsNavigationTarget(NavigationContext navigationContext) but this method appears to never be called.

Where have i gone wrong? Thanks in advance.

解决方案

The problem was in such a place that I never expected...

你可能感兴趣的:(prism项目搭建,wpf)