0

So i created 2 pages named MovieRibbonTab and MovieMainControl and i want them to be connected to my Mainwindow. Below is the code in xaml for the 2 pages.

modularity:ViewRibbonTab x:Class="MovieLibrary2.Modules.Views.MovieRibbonTab" x:ClassModifier="internal"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
  xmlns:local="clr-namespace:MovieLibrary2.Modules.Views"
   xmlns:modularity="clr-namespace:UTILS_WPF.Modularity;assembly=UTILS_WPF"
   xmlns:controls="clr-namespace:UTILS_WPF.Controls;assembly=UTILS_WPF"
   xmlns:ribbon="clr-namespace:Fluent;assembly=Fluent"
   xmlns:vm="clr-namespace:MovieLibrary2.Modules.ViewsModels"
  mc:Ignorable="d" 
  d:DesignHeight="450" d:DesignWidth="800"
  d:DataContext="{d:DesignInstance Type={x:Type vm:MovieViewsModels},IsDesignTimeCreatable=False}">

<ribbon:RibbonGroupBox>
    
    
</ribbon:RibbonGroupBox>

</modularity:ViewRibbonTab>

<modularity:ViewMainControl x:Class="MovieLibrary2.Modules.Views.MovieMainControl" x:ClassModifier="internal"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
  xmlns:local="clr-namespace:MovieLibrary2.Modules.Views"
  xmlns:modularity="clr-namespace:UTILS_WPF.Modularity;assembly=UTILS_WPF"
  xmlns:controls="clr-namespace:UTILS_WPF.Controls;assembly=UTILS_WPF"
  xmlns:vm="clr-namespace:MovieLibrary2.Modules.ViewsModels"
  mc:Ignorable="d" 
  d:DesignHeight="450" d:DesignWidth="800"
  d:DataContext="{d:DesignInstance Type={x:Type vm:MovieViewsModels}, IsDesignTimeCreatable=False}">

<Grid>
    
</Grid>

</modularity:ViewMainControl>

If needed i can provide the cs files aswell.

  • Looks like you pages are actually UserControls. You can display them by adding a ContentPresenter or ContentControl to the main view and define two implicit DataTemplates that contain your controls and put the within the scope of the main view e.g. App.xaml. The bind the view models accociated with the control you wish to show to the ContentControl. Your question is very vague, lacking context related information. Impossible to help. Take a look at [this](https://stackoverflow.com/a/58849975/3141792) and [this](https://stackoverflow.com/a/61323201/3141792) example. – BionicCode Aug 18 '21 at 12:55

0 Answers0