Select to view content in your preferred language

DynamicLayer + VisibleLayers property

586
4
07-14-2010 10:23 PM
BrianBorg
Emerging Contributor
I am setting the VisibleLayers property in xaml

VisibleLayers="2,7,12"

and I am getting this error:


Error 1 Unable to cast object of type 'Microsoft.Expression.DesignModel.DocumentModel.DocumentPrimitiveNode' to type 'Microsoft.Expression.DesignModel.DocumentModel.DocumentCompositeNode'.
0 Kudos
4 Replies
DominiqueBroux
Esri Frequent Contributor
If you get this error in Blend only, it looks like the same issue than
http://forums.arcgis.com/threads/3676-Error-message-explanation-needed
0 Kudos
RobertBurke
Esri Contributor
Brian,

Even though you see the error can you still test Run the app?  I had the same thing and my app still ran. In the end I moved the VisibleLayers property setting from XAML into C#.

Thanks,
Rob Burke
Esri Redlands - Instructor
Rob Burke
0 Kudos
BrianBorg
Emerging Contributor
I had to remove it from xaml and put it in c#.

I am not using blend but VS2010
0 Kudos
dotMorten_esri
Esri Notable Contributor
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.
0 Kudos