Select to view content in your preferred language

Error in casting 'Microsoft...DocumentPrimitiveNode' to '...DocumentCompositeNode'

618
1
01-14-2013 06:16 AM
YurongTan
Regular Contributor
I am looking for a viable solution to the error message that many of us are facing:  Error in casting 'Microsoft.Expression.DesignModel.DocumentModel.DocumentPrimitiveNode' to type 'Microsoft.Expression.DesignModel.DocumentModel.DocumentCompositeNode'.  The problem is not that the app stops working all together, but it is the "legend or Layer List" that become uncontrollable or un-expandable.

According to ESRI, this is the "Microsoft problem" and the only solution is that we wait.  However, I believe ESRI might already have a work-around for this, but ESRI needs to find it out and post it.

The essential functionality for layer listing and legends for "composite" map services fails in the Silverlight API due to this error, but the same functionality works perfectly fine for identical composite map services in apps developed through the GUI  Silverlight Viewer.   This indicates that there might be a readily available solution to this problem, at least in the Viewer GUI.  ESRI needs to find out how the Viewer works in this regard and share that with the rest of us.  Thanks
0 Kudos
1 Reply
DominiqueBroux
Esri Frequent Contributor
but it is the "legend or Layer List" that become uncontrollable or un-expandable.
....
The essential functionality for layer listing and legends for "composite" map services fails in the Silverlight API due to this error,

That's not normal. The issue you pointed out is a design time issue that doesn't impact the runtime.

Could you give more infos on how to reproduce your issue?

I believe ESRI might already have a work-around for this,

To avoid this runtime issue you can either initialize the Legend.LayerIds by code instead of XAML, or you can also keep it uninitialized and set ShowLegend to false on the layers you don't want to see in the legend.
0 Kudos