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.
Hello,
Yes, the map won't update or redraw in this case. List<> doesn't provide the INotifyCollectionChange interface needed for WPF UI components to update it's display when items change in the collection. I recommend holding off on any complete work arounds until we fix the support for using ObservableCollection.
Let me know if you have any questions.
I've just played around with your code, and yes it no longer crashes if I use a list. However changing the lines doesn't (can't) cause a refresh of the display to show the change in lines.
To make it trigger a binding change I put together a multi-binding to monitor both the lines and the number of times a change has been made. The later binding is just there to trigger a change, yet the display never updates, even though you can see the right data being reprocessed by the binding.
Is this because the map is checking the path for reference equivalency when receiving an update and if it is the same won't redraw the original path?
Please see the example attached to illustrate the problem.
I've revised your sample to reproduce the bug and demonstrate how to properly setup a collection of points and draw your lines. During testing (i.e. view model etc.) I wasn't able to resolve the issue. It occurs only when using an ObservableCollection to store the points.
Changing the collection to List and changing the lines, instead of adding them, is a potential work around. However the issue clearly presents to us that there is an development issue with the XamGeographicMap. I've attached your revised sample for your records below.
I have created case for you with ID: CAS-185492-Z8Z0Z3, and a development item: 239701. You could reach your case following the link below:
https://es.infragistics.com/my-account/support-activity I will update you via the mentioned case, so if you have any further questions or comments please update your case.
Thought I give this a bump as a tech said yesterday he'd close the support case and discuss the problem here.
Anxious to get this resolved/understood or explained to me.