如何将Prism 7 WPF集成到旧的大型WinForms应用程序中

查克

我正在尝试将(Prism 7)WPF窗口集成到现有WinForms应用程序中。

我的窗口定义为:

<Window x:Class="ESC.SV.UI.RAndDClient.Views.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:ESC.SV.UI.RAndDClient"
    xmlns:core="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:prism="http://www.codeplex.com/prism"
    xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
    prism:ViewModelLocator.AutoWireViewModel="True"
    mc:Ignorable="d"
    Title="{Binding Title}" Height="450" Width="800">
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <dxb:BarContainerControl Grid.Row="0">
        <dxb:ToolBarControl Caption="Main Toolbar"  BarItemHorizontalIndent="10">
            <dxb:BarButtonItem Content="View 1" Glyph="{dx:DXImage Image=Forward_16x16.png}" Command="{Binding ExecuteView1Command}"/>
            <dxb:BarButtonItem Content="View 2" Glyph="{dx:DXImage Image=Backward_16x16.png}" Command="{Binding ExecuteView2Command}"/>
        </dxb:ToolBarControl>
    </dxb:BarContainerControl>

    <ContentControl prism:RegionManager.RegionName="ViewsRegion" Grid.Row="1" VerticalAlignment="Top"/>

</Grid>

当我启动WinForms应用程序并显示此窗口时,出现以下错误消息:

查看区域错误消息

...解释了在引导程序中覆盖ConfigureRegionAdapterMappings方法,但是当我创建一个继承自UnityBootstrapper的BootStrapper类时,它说这已经过时了。我知道该应用程序应该继承自PrismApplication,但这是否也适用于WinForms应用程序?

非常感谢您提供有关如何处理这种情况的任何建议。

豪金格

我知道该应用程序应该继承自PrismApplication,但这是否也适用于WinForms应用程序?

Prism是WPF应用程序框架(以及UWP和Xamarin)。它不支持WinForms。话虽如此,您甚至可以在没有任何GUI的情况下单独使用Prism的各个部分(例如,事件聚合器在Windows服务中可以正常工作)。

您想在棱镜库中使用什么?基本上,对于每个功能,您都必须查看引导程序如何对其进行初始化和配置,然后将该初始化和配置调整为适合您的应用程序。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何将PrimeNG Designer API集成到现有的Angular 7应用程序中?

如何将Quickblox集成到Xcode 7中

将Umbraco 7集成到现有的MVC 4 Web应用程序中

如何将v7-appcompat支持库捆绑到应用程序源代码中?

如何将NextJS应用程序部署到Linux服务器(CentOS 7)-VPS

如何将Angular 2应用程序集成到Django应用程序中

如何将我的应用程序集成到HL7 V2.5医院HIS?

如何将CCAvenue集成到Ionic应用程序?

如何将Disqus集成到Aurelia应用程序?

如何在Windows7中将sencha touch应用程序部署到iOS应用程序

如何将 HTML 模板中的 css/js 集成到 Laravel 应用程序中?

Citrus SplitPay:如何将Split Pay集成到移动应用程序中

如何将Mustache模板引擎集成到Phalcon PHP应用程序中?

如何将FusionChart集成到使用Durandal和Knockout开发的SPA应用程序中?

如何将BIRT日志集成到应用程序日志中?

如何将Paytm钱包集成到Android应用程序中?

如何将独立的Python脚本集成到Rails应用程序中?

我们如何将Captcha集成到iOS应用程序中?

如何将laravel软件包集成到应用程序中

如何将Paytm钱包集成到Android应用程序中?

如何将Twitter Bootstrap集成到ember-cli应用程序中?

如何将RequireJS模块集成到AngularJS应用程序中?

如何将Samsung Gear Steps集成到android应用程序中?

如何将OPEN_APP_FEATURE操作集成到Android应用程序中?

如何将React应用程序集成到Wordpress(反应路由器)中?

如何将代码集成到闪亮的应用程序中并上传文件?

如何将EmberJS逐步集成到Rails Web应用程序中?

Django:如何将Django Rest框架集成到现有应用程序中?

如何将现有的angular js应用程序集成到Laravel 5中