Internal class reference from Windows workflow activity

I am creating a custom workflow for use in TFS2010. In the same assembly, I have a XAML activity and a C # code activity. XAML activity refers to code activity.

When the assembly is deployed to our customers, I want them to be able to use the Workflow activity. Code activity is little used by itself and undoubtedly confuses them.

I thought the logical way to do this would be to include an inner code activity class: the XAML is in the same assembly and needs to be able to access it. However, when I do this, I get an error in XAML saying the type cannot be found in the assembly.

Is there a way to make the actions internal / hidden?

+2


a source to share


1 answer


This is a common problem with XAML in all its forms. This is caused by the fact (mentioned in one of the comments) that the parser is not in the same assembly and therefore does not have access to the internals of your assembly.

The workaround I've seen most often is to simply highlight what you would like to have as internal in your own namespace. At the very least, your consumers don't usually bother with the confusing types they don't want. In WPF, this namespace is usually the primary namespace with the ".Primitives" application. e.g. System.Windows.Controls.Primitives.



Another skill you can explore is using custom NativeActivity rather than XAML. Presumably this could use inner classes since the XAML parser is not involved. I haven't tested this though.

+1


a source







All Articles