Home > Enterprise >  While assigning exisingmapinstance to new MapView.map facing Object is already owned: Already owned
While assigning exisingmapinstance to new MapView.map facing Object is already owned: Already owned

Time:02-17

While assigning the previous page's map instance to another page's MapView's map then getting an Object is already owned: Already owned exception. how to use the existing map instance to another page with Xamarin.Forms 5.0.0.2337 and Esri.ArcGIS.Runtime 100.0.13.

NewMapView.Map = ExistingMapView.Map;

CodePudding user response:

This can happen if the old MapView is still in memory (or not garbage collected yet). I'd suggest "unhooking" the Map from the MapView when navigating away from the page, so when you get to a new page, you're guaranteed to no longer be attached.

  • Related