locked
WPF re-hosted WF 4 StateMachine RRS feed

  • Question

  • Hi,

    I saw the example of the StateMachine in documentation, but that's WF Console. Is there a way to use WPF re-hosted designer from WF 4 samples?

    This

     

    wd.Load(new StateMachine());

     

    doesn't show correctly (as I was expecting) the StateMachine (it's showing it like a simple Activity, not like a surface on which you can do drag&drop)

    Thank you

    Thursday, September 2, 2010 1:45 PM

Answers

  • Hi SL1234,

    You can use this activities but if you want to see ActivitDesigners you'll ahve to call first the methode Register of DeignerMetadata form asssembly Microsoft.Activities.StateMachine.Design.

    You could do it as this :

    new Microsoft.Activities.Statements.Design.DesignerMetadata().Register();
    
    To work, you'll have first to register Microsoft.Activities.StateMachine.Design.dll in your rehosted designer. you can call this register method before to add activities in your toolbox.
    Jérémy Jeanson MCP, MCTS http://blogs.codes-sources.com/JeremyJeanson/ (French or English spoken)
    • Proposed as answer by JeremyJeansonMVP Thursday, September 2, 2010 3:52 PM
    • Marked as answer by Andrew_Zhu Thursday, September 9, 2010 5:40 AM
    Thursday, September 2, 2010 3:51 PM

All replies

  • I saw that xaml for Console app shows flowchart inside of an activity but I also tried loading a xaml saved with a state added

    wd.Load("Workflow1.xaml");

    but, when I copied "Workflow1.xaml" to WPF project gave the error "The tag 'Dictionary' does not exist in XML namespace 'clr-namespace:System.Collections.Generic;assembly=mscorlib'"

    Thursday, September 2, 2010 3:43 PM
  • Hi SL1234,

    You can use this activities but if you want to see ActivitDesigners you'll ahve to call first the methode Register of DeignerMetadata form asssembly Microsoft.Activities.StateMachine.Design.

    You could do it as this :

    new Microsoft.Activities.Statements.Design.DesignerMetadata().Register();
    
    To work, you'll have first to register Microsoft.Activities.StateMachine.Design.dll in your rehosted designer. you can call this register method before to add activities in your toolbox.
    Jérémy Jeanson MCP, MCTS http://blogs.codes-sources.com/JeremyJeanson/ (French or English spoken)
    • Proposed as answer by JeremyJeansonMVP Thursday, September 2, 2010 3:52 PM
    • Marked as answer by Andrew_Zhu Thursday, September 9, 2010 5:40 AM
    Thursday, September 2, 2010 3:51 PM