1

I'm trying to make Caliburn Micro find my view, which is located in a ResourceDictionary, to be used in a ContentControl.

<Window x:Class="RSA.UI.Prosit.Sales.Views.GenericPrositDialog"  
        <!--  ... -->>
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="PolicyOverview/PolicyOverviewDialogs.xaml"/>
                <!-- ... -->
            </ResourceDictionary.MergedDictionaries>            
        </ResourceDictionary>
    </Window.Resources>
    <Grid MaxHeight="{Binding MaxWindowHeight}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <ContentControl Content="{Binding}"></ContentControl>
    </Grid>
</Window>

In PolicyOverviewDialogs.xaml I have

<DataTemplate DataType="{x:Type vm:NotesViewModel}">
...

How can I get Caliburn Micro's WindowManager to find the view?

Trying things like

_windowManager.ShowDialog(notesVM, null, settings);
_windowManager.ShowDialog(notesVM, "GenericPrositDialogView", settings);

but they all come up short with a message "Cannot find view for NotesViewModel". Anyone has experience with this?

Everything works fine if I make the view its' own file "NotesView.xaml", but that's not what I want.

SamiHuutoniemi
  • 1,576
  • 2
  • 16
  • 35

0 Answers0