Hello,
I have a SfMap control on a Xamarin Forms page. It has an ImageryLayer with Markers bound to a view model.
The first time it loads, everything works fine. The second time you navigate to the page, if you try to add or remove from the MapMarkers list, it throws an error in SfMaps code.
<ContentView.Content>
<maps:SfMaps
x:Name="MyMap"
MinZoom="2"
ZoomLevel="{Binding ZoomLevel, Mode=TwoWay}">
<maps:SfMaps.Layers>
<maps:ImageryLayer
Markers="{Binding MapMarkers, Mode=TwoWay}"
GeoCoordinates="{Binding Location, Mode=TwoWay}" />
</maps:SfMaps.Layers>
</maps:SfMaps>
</ContentView.Content>
private ObservableCollection<MapMarker> mapMarkers;
public ObservableCollection<MapMarker> MapMarkers
{
get { return mapMarkers; }
set { mapMarkers = value; OnPropertyChanged(nameof(MapMarkers)); }
}
Let me know if you can reproduce the problem or if i should try to get some code together for you to test with. I've been mainly testing with UWP.