I have this error when I set the LayerIDs on a TemplatePicker (I am using the code from ESRI Template Picker sample, Visual Studio 2010, Silverlight 4 and ArcGIS API for Silverlight 2.0) :
"Unable to cast object of type 'Microsoft.Expression.DesignModel.DocumentModel.DocumentPrimitiveNode' to type 'Microsoft.Expression.DesignModel.DocumentModel.DocumentCompositeNode'"
Unfortunately this is a bug in VS2010 (it used to be there in Blend 4 as well, but got fixed after we reported it - unfortunately didn't make it for VS2010). You code will still compile and run though.