Custom State Activity with Custom Designer
I have a custom activity which inherits from StateActivity. I implement my own FreeFormActivityDesigner and override the OnPaint event. When using a the state workflow designer either in VS or the re-hosting example the OnPaint event gets called and the shape is correctly painted while dragging the shape to the designer surface. However after dropping the shape it is not rendered even though the properties show up in the property sheet. I have looked at the FlowChart custom designer code but I must be missing something. If I drag and drop the shape in a sequential workflow it renders just fine.
Any help would be greatly appreciated.
smc750
[669 byte] By [
smc750] at [2007-12-22]
So, if I create a custom StateActivity (MyCustomStateActivity) and set designer to [Designer(typeof(ActivityDesigner), typeof(IDesigner))], when I drag and drop MyCustomStateActivity to StateMachineWorkflow does it will display?
Ok. But I think that, if the StateDesigner class was public, the work will be more simple.
Why does StateDesigner class is not public?
Yes, that is the big mystery. All of the support classes for state activities are not public. It is strange that MSFT would enable you to extend the state activity, yet if you want to extend its behavior in the designer you must write it all. The FreeFormActivityDesigner lacks much of the functionality that the StateDesigner has. For example the ability to auto-connect state activities after setting the TargetState property of a contained SetStateActivity.
smc750