dragablz TabablzControl不会激活RequestNavigate上的tabpage / view

时间:2016-07-28 04:01:22

标签: wpf prism tabcontrol

当注册视图时,它首次显示,但是如果我在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");
        }
    }

1 个答案:

答案 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));