Custom activity designer with specific Expand\Collapse behavior
I am trying to create a designer for a custom WF4 activity with the Expand/Collapse ability with the following characteristics:
- when first added to the workflow designer (Visual Studio designer not a custom one) the activity should be collapsed.
- when double clicked on the activity, regardless if it is expanded or collapsed, the designer should open it in the "single activity mode" as expanded.
I have a version of the designer inspired from the one presented in: http://xhinker.com/2010/03/16/WF4CreateACustomActivity.aspx but the activity designer does not behaves as I would want.
If I am using: <DataTrigger Binding="{Binding Path=ShowExpanded}" Value="true">
the second characteristic is as expected but the first one obviously it isn't becaus开发者_开发知识库e when first added in the workflow designer the activity is present as expanded.
I tried to set the ShowExpanded value on false but then the second condition is not OK, the VS designer opening my activity as collapsed when double clicking on it.
Is there any way in which an activity designer fulfilling both conditions, would be possible to be implemented?
Also it would be great for me to find out if there is a way to "persist" the view state(Expanded or Collapsed) of a custom activity, so if the activity was collapsed (or expanded) when the containing workflow definition was last time viewed to be opened as collapsed (or expanded by case)?
As for your last question, you can use the ViewStateService to store view state information in the workflow XAML file.
As for your first question, I believe you can force the activity to be collapsed on drop if, in the xaml, you set ExpandState to false
. Honestly, it is a little hard to understand what exactly is going on with your workflow designer that you're not happy with...
精彩评论