none
Reuse user control with map across pages RRS feed

  • Question

  • Hi,

    we're currently trying to integrate Bing Maps into several spots of our existing Windows Store App, wrapped in a Usercontrol which adds some management functionality around it. But we are facing some troubles with resource consumption/memory allocation when navigating between pages where the control appears, as already stated in some other threads here. Reading those has already taught me that the only way to overcome this would be to instance the map only once and share it across all pages, however, the solution proposed in this tread doesn't really work for us since that would basically require a redesign of the entire app around the map.

    There are various pages that use the user control/map, at one appearing in a flyout, at another one in fullscreen, and also in some dialogs. What would be the best way to make a single instance of the map available to all these different scenarios, while still having it accessible via the wrapping user control?

    Add: we already did a test instancing the map only once in the user control and storing it in a static member, thus providing this static reference to all other future instances of the user control - but as soon as a second control is instantiated the map complains about missing/wrong credentials, no matter if we set them again or not.

    Any help is greatly appreciated!

    Friday, May 9, 2014 7:10 PM

Answers