How can I Host the WorkflowDesigner of WorkflowFoundation 4 in a Winforms application?

荒凉一梦 提交于 2019-12-02 13:16:50

问题


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

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

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

Thanks!


回答1:


Solved!

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

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

Only was needed to add the missing line "new DesignerMetadata().Register();"

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



来源:https://stackoverflow.com/questions/5045971/how-can-i-host-the-workflowdesigner-of-workflowfoundation-4-in-a-winforms-applic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!