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

前端 未结 1 837
礼貌的吻别
礼貌的吻别 2021-01-24 06:58

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 d

相关标签:
1条回答
  • 2021-01-24 07:50

    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! ;)

    0 讨论(0)
提交回复
热议问题