Navigating between pages with Maps

5022
3
12-26-2014 06:22 AM
MikeHamsa
New Contributor

Hello,

I'm working on a universal app with multiple pages; with the main page containing the MapView. Right now I'm focusing on Windows Phone and I'm having some trouble with the page navigation. When I enable NavigationCacheMode on the main page and that page gets navitaged to from another page, the MapView and the Map on the main page are completely unresponsive.

I did a little more testing with a very simple Windows Phone app (universal). I started with the ArcGIS Runtime 10.2.4 for .NET App (Universal App)  template that defines an app with a single page which contains a MapView, a Map and a single basemap layer.  I added a second page - a blank page - and added a list view with basemap layers from ArcGIS Portal . When the use picks a basemap, the app navigates back to the main page and replaces the basemap layer in the map. But when NavigationCacheMode is enabled or required the MapView and the Map are no longer responsive.

Also, I'm not using the NavigationHelper classes added with the Basic page.

When NavigationCacheMode is disabled, the main page obviously gets reconstructed when it is navigated to so everything is back to its original state. And even this seems to be unreliable. I built a small class to save off some of the map state when the main page is navigated from and then use it to restore the map state when the main page is navigated back to and this only works a few times before the app eventually crashes.

I noticed that most of the samples I've seen only contain a single page - is this by design?

Am I doing this correctly, and if so, are there any known issues with the NavigationCacheMode. Enabling NavigationCacheMode seems to be the correct way of doing this but the runtime doesn't seem to react well with it enabled.

Any suggestions?

Thanks in advance,

mike...

0 Kudos
3 Replies
RistoMoilanen
New Contributor

We also have same crashing problem when navigating from Page containing Map to another Page and then Back. Symptoms are just same than Mike described..

Any solutions found for this Page navigation problem?

0 Kudos
RistoMoilanen
New Contributor

Is there any plan to improve Map Control behaviour in multi-page application case?

In nutshell: We have memory-leak problem when re-creating Map Control on Page Transitions and NavigationCacheMode is unusable here because map control freezes when using NavigationCacheMode=Enabled.

Any comments?

0 Kudos
dotMorten_esri
Esri Frequent Contributor

Yes this is a known issue and will be fixed in the very-soon-to-be-released 10.2.5 update. Stay tuned...

Until then, disable the navigation cache mode.

Wrt to the memory leak, are you accidentally holding on to anything on the mapview to cause this? (the typical example is event handlers from a longer-lived object listened to from the view that's leaking)

0 Kudos