1

I am rehosting WF4 workflow designer.

For a state machine, I don't know how to provide a "FinalState" via sapt:ToolboxItemWrapper in XAML.

There is no FinalState class, only a State class for "regular" states. State class has a IsFinal property, so I guess it has to be set in order to become a "FinalState".

I tried deriving my own FinalState class from State that would set IsFinal in the constructor, but it doesn't work as State is sealed.

So how can I provide FinalState from XAML?

1 Answers1

0

There actually is a FinalState class, just in a different assembly. So to add state machine use:

<Window.Resources>
    <sys:String x:Key="AssemblyName">System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</sys:String>
    <sys:String x:Key="SACPAssemblyName">System.Activities.Core.Presentation, Version=4.0.0.0, Culture=neutral, PublicKeyToken="31bf3856ad364e35"</sys:String>
</Window.Resources>


<sapt:ToolboxCategory CategoryName="State Machine">

  <sapt:ToolboxItemWrapper  AssemblyName="{StaticResource AssemblyName}">
       <sapt:ToolboxItemWrapper.ToolName>
          System.Activities.Statements.Statemachine
       </sapt:ToolboxItemWrapper.ToolName>
  </sapt:ToolboxItemWrapper>

  <sapt:ToolboxItemWrapper  AssemblyName="{StaticResource AssemblyName}">
       <sapt:ToolboxItemWrapper.ToolName>
          System.Activities.Statements.State
       </sapt:ToolboxItemWrapper.ToolName>
  </sapt:ToolboxItemWrapper>

  <sapt:ToolboxItemWrapper  AssemblyName="{StaticResource SACPAssemblyName}">
       <sapt:ToolboxItemWrapper.ToolName>
          System.Activities.Core.Presentation.FinalState
       </sapt:ToolboxItemWrapper.ToolName>
  </sapt:ToolboxItemWrapper>

</sapt:ToolboxCategory>