abs_Z3r0

Is it possible to change one activity label that appears on the layout at design time for example, instead of showng the name, show it's description


Re: Windows Workflow Foundation changing activity layout label

Denis R - MSFT

This is possible for custom acitivies. Here is an example that will do what you are describing for a custome Activity, Activity1.

(This would code in the Activity1.Designer.Cs file.)

Code Snippet

[Designer(typeof(MyDesigner), typeof(IDesigner))]

public partial class Activity1

{

#region Designer generated code

...

#endregion

}

public class MyDesigner : SequenceDesigner

{

public override string Text

{

get

{

return this.Activity.Description;

}

protected set

{

base.Text = value;

}

}

protected override void OnActivityChanged(ActivityChangedEventArgs e)

{

this.Text = this.Activity.Description;

base.OnActivityChanged(e);

}

}

I don't think there is a way to do what you describe with out-of-the-box activities.






Re: Windows Workflow Foundation changing activity layout label

abs_Z3r0

in my case i have a state custom activity, and i can add EventDrivenActivities to it, and those are athe ones i'd like to change the label... i can't make a custom class derived from EventDrivenActivity so i guess it's not possible....

thanks




Re: Windows Workflow Foundation changing activity layout label

Denis R - MSFT

Yes you are correct, unfortunatly that scenario is not possible.






Re: Windows Workflow Foundation changing activity layout label

abs_Z3r0

what about a custom activity derived from "State" activity




Re: Windows Workflow Foundation changing activity layout label

abs_Z3r0

i tryed using that designer class, but inherit from "CompositeActivityDesigner" instead, but it must be necessary something more... because VS freaks out with arrows going of the screen and such...
anyone knows what that is

thanks!




Re: Windows Workflow Foundation changing activity layout label

Tomas Restrepo

That doesn't work too well either, I'm afraid. Most significant here is that the designer for the State activity is internal, so you can't derive from it, so you'd have to do a lot of work to mimic how it works on your own custom state activity.




Re: Windows Workflow Foundation changing activity layout label

Ivana Vozkova

I have the same problem. Do I really have to rewrite whole designer FreeformActivityDesigner when I need just change label for EventDriveActivity inside my StateActivity Exist some example

Thanks

Ivana