1
votes

I'm building application with multiple modules. Each of module contains a viewmodel and view.

I would like to create solution, for automatically show SelectedModule in a part of my application.

Assume that I have MainWindow view like this:

<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>

And I would like to show a UserControl specified in another DLL inside MainView ContentControl after Ribbon item click.

Both, Ribbon Button and MainView view are in module DLL

I had an idea to include SelectedViewModel inside my MainPage ViewModel, and then, create DataTemplates for each ViewModel, but this solution will break my vision of Modules, which should be independent.

Is there a way in Catel to replace a view with another one? From anywhere?

1

1 Answers

0
votes

I think Prism solves this issue for you. Please take a look at the integration of Prism with Catel:

https://catelproject.atlassian.net/wiki/display/CTL/Catel.Extensions.Prism