Esri / arcgis-maps-sdk-dotnet-toolkit

Toolkit for ArcGIS Maps SDK for .NET
https://esri.github.io/arcgis-maps-sdk-dotnet-toolkit/
Apache License 2.0
217 stars 121 forks source link

Table of contents error when change base map (v100) #131

Closed GeoITwinkle closed 7 years ago

GeoITwinkle commented 7 years ago

File Location: arcgis-toolkit-dotnet/src/Esri.ArcGISRuntime.Toolkit/WPF/UI/Controls/TableOfContents/ObservableLayerContentList.cs Line 89: foreach (var item in e.NewItems.OfType()) Suspected wrong code: "e.NewItems" should be "e.OldItems"?

This causes errors when you change the base map, while the table of contents is opened.

Simple repro step:

  1. Make a simple WPF app by following the example of Esri: https://developers.arcgis.com/net/latest/wpf/sample-code/changebasemap.htm
  2. Add a table of contents control to the app.
  3. When debugging, open the table of contents and change the base map. It will throw errors at Line 89.

I tried changing the code from "e.NewItems" to "e.OldItems", exception disappeared at Line 89, but new errors thrown at other places. So, I am not sure how to fix it.

dotMorten commented 7 years ago

Good catch!

dotMorten commented 7 years ago

Fixed with commit https://github.com/Esri/arcgis-toolkit-dotnet/commit/c8e548a4705f67116b6e5792b10c6a86501483d3