C# Catel框架-替换视图

C# Catel框架-替换视图,c#,wpf,mvvm,catel,C#,Wpf,Mvvm,Catel,我正在用多个模块构建应用程序。每个模块都包含一个viewmodel和一个view 我想创建一个解决方案,用于在我的应用程序的一部分中自动显示SelectedModule 假设我有如下主窗口视图: <catel:UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

我正在用多个模块构建应用程序。每个模块都包含一个viewmodel和一个view

我想创建一个解决方案,用于在我的应用程序的一部分中自动显示SelectedModule

假设我有如下主窗口视图:

<catel:UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:catel="http://catel.codeplex.com" xmlns:dxsch="http://schemas.devexpress.com/winfx/2008/xaml/scheduler"
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
    xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
    x:Class="OrchestraCatel.Views.MainWindow">

  <DockPanel LastChildFill="True">
    <ContentControl x:Name="Ribbon" DockPanel.Dock="Top">
<!--      My Ribbon-->
    </ContentControl>
    <ContentControl x:Name="MainView" DockPanel.Dock="Top">
<!--      My Main Page-->
    </ContentControl>
  </DockPanel>
</catel:UserControl>
我想在单击功能区项后,在MainView ContentControl内的另一个DLL中显示指定的UserControl

功能区按钮和MainView视图都位于模块DLL中

我有一个想法,将SelectedViewModel包含在我的主页ViewModel中,然后为每个ViewModel创建数据模板,但这个解决方案将打破我对模块的看法,模块应该是独立的


Catel中是否有方法将一个视图替换为另一个视图?从任何地方?

我认为Prism为您解决了这个问题。请看一下Prism与Catel的集成: