如何在 Winforms 应用程序中托管 WorkflowFoundation 4 的 WorkflowDesigner? [英] How can I Host the WorkflowDesigner of WorkflowFoundation 4 in a Winforms application?

查看:20
本文介绍了如何在 Winforms 应用程序中托管 WorkflowFoundation 4 的 WorkflowDesigner?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对标题本身没有太多解释,哈哈.

I don't have much explanation that the tittle himself, lol.

但是,我真正想做的是在 Winform ElementHost 控件上加载 de WorkflowDesigner.

But, what I really want to do is load de WorkflowDesigner on an Winform ElementHost Control.

我尝试这样做:在 WPF 应用程序中托管 WorkflowDesigner,但它不起作用.

I try doing this: Host WorkflowDesigner in a WPF Application, but it doesn't work.

谢谢!

推荐答案

已解决!

private void Form1_Load(object sender, EventArgs e)
{
    new DesignerMetadata().Register(); //Missing Line

    des = new WorkflowDesigner();
    des.Load(mFileName);
    elementHost1.Child = des.View;
}

只需要添加缺少的行new DesignerMetadata().Register();"

注意:elementHost1 是一个 WinForm ElementHost 控件,直接来自工具箱!;)

Note: elementHost1 is a WinForm ElementHost Control, direct from the toolbox! ;)

这篇关于如何在 Winforms 应用程序中托管 WorkflowFoundation 4 的 WorkflowDesigner?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆