Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
565
Crash when modifying a collection of lines used by geopolyline (CAS-185490-D9F9K8)
posted

I just filed a support request number (CAS-185490-D9F9K8), but I thought I;d post it here a well in case anyone else has seen similar behavior.

Is you build and run the attached solution a window appears with a big X in the middle of it.

Double click on the map.

When processing the double click an error will generate about unable to convert a PointList to an IEnumerable<IEnumerable<Point>>.

If you look in the handler for the double click, in the comment is a solution when bound view model object (In this case a dependency property on the main window) can be set to null.  It is inappropriate for situations (which is really my problem) where the view model only exposes a read-only collection, so the only thing you can do is clear followed by an addition to that collection.

Perhaps I am not binding to the control properly, but I couldn't find a useful example where a geopolyline is bound to a collection of points that can change.  There are lots on using shapefiles, but those aren't appropriate for me as my data is generated programmatically and it would be a performance hit to generate a shapefile then read the shapefile back in just to make the xamgeographicmap work.

Any help you can give me on making the included example work, without setting the bound property to null, would be appreciated.

WpfApp1.zip