I have been working Tech Support for this issue for quite some time and it seems to me the analyst just can't find the solution. I am going to give it a shot here.
I created a Legend to control (turn on/off, change Opacity, etc.) the map layers in an app and this Legend works fine. In a test, the Legend works elegantly that each layer inside the Legend can be turned on, off, expanded, and collapsed and changed opacity. However, when this Legend is merged with the app, it stays flat and non-expandable. Because of that I tested this Legend under two test apps created from the ESRI Standard and Showcase silverlight templates (3.0) and surprisingly the Legend does not for those test apps either. There is no complilation errors of any kind.
From time to time, a warning message will pop up (see attachment) and the message says (let me type it):
[InvalidCastException was thrown on "Legend": Unable to cast object of type 'Microsoft.Expression.DesignModel.DocumentModel.DocumentPrimitiveNode' to type 'Microsoft.Expression.DesignModel.DocumentModel.DocumentCompositeNote'. Clik here for detail. ]
This problem has been sitting there for over a month and it seems like going no where. Any help or pointers here? Thanks in advance.