c# - PRISM RequestNavigate 不起作用

标签 c# wpf prism

我正在使用 PRISM,并且在 XAML MainWindowView 中有 2 个区域:

<IG6:SplitPane IG6:XamDockManager.InitialLocation="DockedTop"> 
<IG6:TabGroupPane x:Name="MessageGroupPane" prism:RegionManager.RegionName="{x:Static inf:RegionNames.MessageGroupPane}">

<IG6:SplitPane IG6:XamDockManager.InitialLocation="DockedBottom"
<IG6:TabGroupPane x:Name="MainContentGroupPane"  prism:RegionManager.RegionName="{x:Static inf:RegionNames.MainContentGroupPane}">   

public class InfrastructureModule : IModule
{
    container.RegisterType<IMessageViewVM, MessageViewVM>();
    container.RegisterType<object, MessageView>("MessageView");
    regionManager.RegisterViewWithRegion(RegionNames.MessageGroupPane, typeof(MessageView));
}

当代码执行时,所有 View 都放置在 XAML 中标识的最后一个 tabGroupPane 中(在本例中为 MainContentGroupPane),而不是位于请求的区域中消息组 Pane

我正在使用 Brian Lagunas 提供的示例中的 TabGroupPaneRegionActiveAwareBehavior。 View 显示正确,但我无法将它们放置在特定区域。有人能指出我正确的方向吗?

最佳答案

您应该在模块中注册用于导航的目标 View TargetView:

    container.RegisterTypeForNavigation<TargetView>();

关于c# - PRISM RequestNavigate 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42773996/

相关文章:

c# - 您如何遍历类的属性?

c# - ASP.NET 缓存之间的区别

c# - 必须在使用 DocumentClient 的 CosmosDB 删除操作中为此操作提供 PartitionKey 值

c# - Canvas 上的 MouseLeftButtonDown 需要太高的精度

c# - 事件聚合器与服务

c# - 使用 Entity Framework 和 WCF 的大型应用程序

c# - 鼠标右键的WPF按钮命令?

c# - 用户控件作为具有绑定(bind)的数据模板

wpf - Prism MVVM 的高级建模建议

mvvm - PRISM 中的设计模式