locked
Using List<T> as a binding property RRS feed

  • Question

  • I have been running into an issue while using a collection as a dependency property between two activities. Apparently when I define a custom List (say List<MyClass>) in an activity and try to bind it with the same List type of a subsequent activity, I run into problems. For the first run, everything seems ok. However, when I close the activity and reopen the file, the designer throws an error stating that it cannot assign object of type List<MyClass> to object of type List<MyClass>. Since the designer fails to load, there is no way for me to modify a composite activity/workflow any further. The code does compile and works fine in terms of functionality so my hunch is that this is only a designer level issue.  In case of an ArrayList, there is no such binding issue.

    Tuesday, May 12, 2009 7:24 PM

Answers


  • From PM of designer Team:

    Generic were never fully supported in the framework. We never added any features or interlocks that would keep developers from using them. You should expect to run into strange failures when using generic, like the one you just encountered. The workaround is not using generic.

    We do not plan to add support for generics to the WF 3.5 stack now or in the future. The new WF 4.0 stack does have full support for generics. At the moment WF 4.0 is not directly compatible with 3.5. This means that you cannot plan on having generics available in your system when Dev10 ships.

    I am sorry to report that you should abandon the idea of using generics in WF 3.5.

     

    Monday, May 18, 2009 1:48 PM
    Moderator

All replies

  • If you want it work in Designer, I'd suggest you create a wrapper class on the List<MyClass>, then it becomes a matter of binding an object, not a collection.

    Hope it helps,
    -Hong
    Wednesday, May 13, 2009 3:57 AM
    Moderator

  • From PM of designer Team:

    Generic were never fully supported in the framework. We never added any features or interlocks that would keep developers from using them. You should expect to run into strange failures when using generic, like the one you just encountered. The workaround is not using generic.

    We do not plan to add support for generics to the WF 3.5 stack now or in the future. The new WF 4.0 stack does have full support for generics. At the moment WF 4.0 is not directly compatible with 3.5. This means that you cannot plan on having generics available in your system when Dev10 ships.

    I am sorry to report that you should abandon the idea of using generics in WF 3.5.

     

    Monday, May 18, 2009 1:48 PM
    Moderator