2017-02-07 23 views

ответ

1

Существует Offical пример доступен на GitHub: https://github.com/PrismLibrary/Prism-Samples-Wpf/tree/master/HelloWorld

Этот пример использует Unity и ViewA использует вид модели locatator для создания экземпляр ViewAViewModel: https://github.com/PrismLibrary/Prism-Samples-Wpf/blob/master/HelloWorld/Modules/ModuleA/Views/ViewA.xaml

<UserControl x:Class="ModuleA.Views.ViewA" 
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
      xmlns:prism="http://prismlibrary.com/" 
      prism:ViewModelLocator.AutoWireViewModel="True"> 
    <Grid> 
     <TextBlock Text="{Binding Title}" Foreground="Green" HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="Calibri" FontSize="24" FontWeight="Bold"></TextBlock> 
    </Grid> 
</UserControl>