Freigeben über


Base Designer with additional adornments II

Couple of customers reported an issue with applying additional adornments on the designer discussed in this post. The issue was for out of box activities which didn't have a custom designer(were using the ActivityDesigner) itself, the adornments were not working. An example would be the Delay activity.

Currently, we don't have a clean solution to this as the ActivityDesigner has an implicit style which is picked up by WPF. And if there is such an implicit style, the App.Resources style in our application never gets picked up.

The workaround that we have suggested is to create a simple DerivedDesigner from ActivityDesigner and then apply it on for all types that are using just the ActivityDesigner. This has to be done after loading the Workflow though rather than in the RegisterMetadata section.

 AttributeTableBuilder table = new AttributeTableBuilder();
table.AddCustomAttributes(typeof(Activity), new DesignerAttribute(typeof(DerviedDesigner)));
MetadataStore.AddAttributeTable(table.CreateTable());

Hope this helps!

Thanks,

Kushal.

Comments

  • Anonymous
    June 16, 2010
    Hi. could you please provide us with the source code to this?

  • Anonymous
    June 16, 2010
    The comment has been removed

  • Anonymous
    March 30, 2011
    This doesn't work unless you also add an extra style to App.xaml (copy/paste the existing style that is applied to ActivityDesigner and apply it to DerievedDesigner):

  • Anonymous
    February 16, 2012
    Hi Kushal, What happens if I don't derive my designer from ActivityDesigner, but instead from WorkflowViewElement? In this case I do not see the adornments. Radu