当注册视图时,它首次显示,但是如果我在tabablzcontroll上加载其他视图后尝试查看它,则它不会导航到上一个视图。视图创建策略是共享的
[PartCreationPolicy(CreationPolicy.Shared)]
假设IsActive = true
private void ResourceShow()
{
if (IsActive)
{
if (!regionManager.Regions[RegionNames.MainContentRegion].Views.Contains("vResource"))//WPFApp.View.uEmployeeView
{
regionManager.RegisterViewWithRegion(RegionNames.MainContentRegion, typeof(vResource));
}
regionManager.RequestNavigate(RegionNames.MainContentRegion, "vResource");
}
}
答案 0 :(得分:0)
您需要将TabControl注册为Region。
<TabControl prism:RegionManager.RegionName="SearchRegion" />
注册模块时
_container.RegisterType<object, MoviesView>(nameof(MoviesView));
_regionManager.RegisterViewWithRegion("SearchRegion", typeof (MoviesView));
导航
_regionManager.RequestNavigate(
"SearchRegion",
new Uri("MoviesView", UriKind.Relative));