Hello again,
actually the situation is more complex.
I tried to solve the problem by setting the center of ImagerLayer in the Loaded event of the polyline.
It works, but not always. As an example, using Bing doesn't work (but it works in your sample code, for some reason I still don't understand).
Also, creating the polyline by code, and not in the xaml, produces the same exception, even without setting the ImagerLayer center.
I am attaching a zip file containing the xaml and cs files of MainWindow. You can replace in your sample code to reproduce the error. Notice that the same exception is raised also without settings any property of SubShapeFileLayer mapLine, i.e. by simply writing:
SubShapeFileLayer mapLine=new SubShapeFileLayer();
BingLayer.SubShapeFileLayers.Add(mapLine);
Andrea
Attachment:
MainWindow.xaml_c4b39264.zip