How to define a designer for an activity
-
Add the Designer attribute to the Activity class
-
Assign ActivityDesigner name in the Activity Constructor
-
By overriding cacheMetadata
-
None of the above
To associate a custom designer with an activity in WF4.0, you apply the Designer attribute to the activity class. This attribute specifies which designer class should be used to visually represent the activity. The attribute typically points to a class derived from ActivityDesigner. The other options are not valid mechanisms for designer association.
In Windows Workflow Foundation, you associate a custom designer with an Activity by applying the [Designer(typeof(YourActivityDesigner))] attribute to the Activity class, which tells the Workflow Designer host which UI class to use when rendering that activity in the designer surface. Assigning a name in the constructor doesn't wire up design-time rendering, overriding CacheMetadata affects runtime metadata (arguments/constraints) not the designer, and 'None of the above' is wrong since the Designer attribute is precisely the documented mechanism.