workflows seem to be created straight from Xaml. How then is would it be possible to include a System.Attribute on my workflow classes?
The only ways i can think of are a bit crap:
Have a corresponding code file for each Activity.xaml:
[MyCustomAttribute("hello")]
public abstract class MyPointlessWorkflowBase : System.Activity
{
}
And then having my .xaml inherit from the base (i don’t even know if this is possible)? But this sucks as i have to an extra class for each Workflow that requires the attribute.
is there anyway to code activities like they were normal classes before you slap the .xaml over it?
A XAML file generates a class with a partial keyword before it gets compiled so you can create a partial class with the same name and add the attribute there.
Alternatively you can add an attribute in XAML using the x:ClassAttributes element and add them that way.