<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Reusing Map control causes map to freeze in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723675#M9121</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;is that issue same as &lt;A _jive_internal="true" href="https://community.esri.com/thread/164576"&gt;here&lt;/A&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Sep 2015 10:47:18 GMT</pubDate>
    <dc:creator>AnttiKajanus1</dc:creator>
    <dc:date>2015-09-03T10:47:18Z</dc:date>
    <item>
      <title>Reusing Map control causes map to freeze</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723660#M9106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In our Windows Store App (not a map centric app) we use the same map (and map control) on several different pages within the application.&amp;nbsp; This was done for several reasons, including performance, keeping the map state etc. and originally dealing with a memory leak in the map control when loading/unloading/recreating.&amp;nbsp; We do this by creating one generic map control and keeping it in the application wide state and reusing when necessary. We create the control and initialize it once and then add/remove the control to the xaml tree when navigating to/from a page that requires a map something like this;&lt;/P&gt;&lt;P&gt;ContentGrid.Children.Add(App.ArcGISMapCtrl); //ContentGrid is a xaml grid&lt;/P&gt;&lt;P&gt;and for removing;&lt;/P&gt;&lt;P&gt;ContentGrid.Children.Remove(App.ArcGISMapCtrl);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This has been working great for us during all the Beta releases but in this Final release we now get the following behavior;&lt;/P&gt;&lt;P&gt;The first time a page is loaded and we create the map everything works fine and as expected.&amp;nbsp; Any subsequent navigation to the same page or any other page with a map the page loads fine but the map control is frozen.&amp;nbsp; Everything else works on the page except the map, is just hung or something.&amp;nbsp; I can see it, but it is not allowing any interaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can get the map working on all page loads if I re-create the Map control on every page navigation but this kind of defeats the point since everything has to be re-initialized, as well the maps state is lost and would have to be saved/reloaded each time.&amp;nbsp; The reusing of the map control has been working great for us as users only see some lag in the first map load, but after that maps are always ready right away and in the same state they left.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Was something major changed in the Final release that might affect this?&amp;nbsp; Any suggestions on what I could try differently?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 16:06:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723660#M9106</guid>
      <dc:creator>SimonFisher</dc:creator>
      <dc:date>2014-10-27T16:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing Map control causes map to freeze</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723661#M9107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We can reproduce the issue you're describing. Unfortunately there's not a quick workaround for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I suggest you keep your Map around and assign it to a new MapView on each page. That will save you a lot initialization steps and should make the map load a lot quicker as well. If there's any other state you want to retain (like extent), you can store that as well (in that case, update myMap.InitialViewport = new Viewpoint(myMapView.Extent) when you leave a page).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 16:28:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723661#M9107</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2014-10-28T16:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing Map control causes map to freeze</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723662#M9108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I'll play around with your suggested workaround.&amp;nbsp; Unfortunately this will result in a lot of extra coding and possibly affect performance.&amp;nbsp; Do you think its likely this could be fixed in a future release?&amp;nbsp; Also, please let me know if you think of any other workarounds I could try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 17:09:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723662#M9108</guid>
      <dc:creator>SimonFisher</dc:creator>
      <dc:date>2014-10-28T17:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing Map control causes map to freeze</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723663#M9109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hope we will be able to improve this - I do see the benefit (albeit it goes a lot against the MVVM pattern). Hanging on to UI controls in memory has it's share of caveats too, so it's not something I would promote unless really needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 17:49:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723663#M9109</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2014-10-28T17:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing Map control causes map to freeze</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723664#M9110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Agreed, hanging onto the control and reusing is not a common or best practices approach, but it seems to work very well for us in our particular scenario, especially for performance.&amp;nbsp; I'll see how it performs with the suggested changes and let you know, but if its not a difficult change on your end to fix it would definitely be appreciated in a future release.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2014 13:15:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723664#M9110</guid>
      <dc:creator>SimonFisher</dc:creator>
      <dc:date>2014-10-29T13:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing Map control causes map to freeze</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723665#M9111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the issue here that the MapView object has to be newly created in xaml on every page load or else it freezes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried to deal with this in code behind because I am actually tying to hold on to my own custom control which in turn contains the MapView and Map objects.&amp;nbsp; Therefore I am doing something like this below, but it still freezes on second attempted view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//when leaving page null MapView&lt;/P&gt;&lt;P&gt;this.MyMapView = null;&lt;/P&gt;&lt;P&gt;this.PreviousExtent = this.MyMapView.Extent;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//when entering page create new MapView on Custom Control and assign existing map and previous extent&lt;/P&gt;&lt;P&gt;this.MyMapView = new MapView();&lt;/P&gt;&lt;P&gt;this.MyMap.InitialViewpoint = new Viewpoint(this.PreviousExtent);&lt;/P&gt;&lt;P&gt;this.MyMapView.Map = this.MyMap;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Nov 2014 19:31:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723665#M9111</guid>
      <dc:creator>SimonFisher</dc:creator>
      <dc:date>2014-11-06T19:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing Map control causes map to freeze</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723666#M9112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;UIElement caching is not recommended, and currently not supported by the MapView either. So yes the MapView should be recreated on each page. You can (and should) cache the map though. We're are looking at if we can improve this in the future to increase load speed from page to page. But be aware that this approach can create some significant memory consumption and hold on to a lot more objects than you might want to.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 18:57:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723666#M9112</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2014-11-07T18:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing Map control causes map to freeze</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723667#M9113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Morten!&lt;/P&gt;&lt;P&gt;Do you mean, että using MapView on Page which has NavigationCacheMode=Required is not supported scenario? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have same crashing problem mentioned here (&lt;A href="https://community.esri.com/thread/119042"&gt;Navigating between pages with Maps&lt;/A&gt; ) when navigation between Map Page and another Page. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We thought that NavigationCacheMode=Required could help with this issue, but that's not supported with page containing map view?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Risto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 16:31:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723667#M9113</guid>
      <dc:creator>RistoMoilanen</dc:creator>
      <dc:date>2014-12-31T16:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing Map control causes map to freeze</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723668#M9114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the release notes at 10.2.6 it seems this issue has been fixed correct?&amp;nbsp; We can now safely reuse the map control? Or do you still suggest not doing this unless absolutely necessary?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 13:15:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723668#M9114</guid>
      <dc:creator>SimonFisher</dc:creator>
      <dc:date>2015-07-15T13:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing Map control causes map to freeze</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723669#M9115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It should be - are you saying it isn't working for you?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 18:54:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723669#M9115</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2015-07-15T18:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing Map control causes map to freeze</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723670#M9116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, I haven't tried yet.&amp;nbsp; Still deciding if its worth going back to my original implementation of reusing the map control which was back during the Beta. It may be better performance and hold onto state for me, but not sure if its worth it since we haven't really had major performance issues.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 20:05:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723670#M9116</guid>
      <dc:creator>SimonFisher</dc:creator>
      <dc:date>2015-07-15T20:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing Map control causes map to freeze</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723671#M9117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Morten Nielsen:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can (and should) cache the map though. &lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3050"&gt;Morten Nielsen&lt;/A&gt;, How do you do this? Is it possible while using mvvm too?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this?? &lt;A href="http://stackoverflow.com/questions/13917303/how-to-pass-a-complex-object-between-pages-in-a-windows-store-app"&gt;http://stackoverflow.com/questions/13917303/how-to-pass-a-complex-object-between-pages-in-a-windows-store-app&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2015 00:15:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723671#M9117</guid>
      <dc:creator>MattMiley</dc:creator>
      <dc:date>2015-08-31T00:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing Map control causes map to freeze</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723672#M9118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your view model should contain a Map property, that you bind to the MapView when navigating to the map page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&amp;lt;esri:MapView Map="{Binding MyViewModelInstance.Map}" /&amp;gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2015 16:30:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723672#M9118</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2015-08-31T16:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing Map control causes map to freeze</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723673#M9119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are different mechanisms to share complex objects across the ViewModels. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way to handle this is to use a proxy class that manages the Map instance and that is shared between the ViewModels. The "manager/service/controller" approach is fairly common especially if you are using dependency injection (DI). Also static controller classes should work just fine to share references in MVVM fashion if you aren't using IoC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also extend navigation pattern to deliver any object to the next page. Something like &lt;A href="http://stackoverflow.com/questions/13654379/how-do-i-pass-non-string-parameters-between-pages-in-windows-phone-8"&gt;this&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Sep 2015 09:17:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723673#M9119</guid>
      <dc:creator>AnttiKajanus1</dc:creator>
      <dc:date>2015-09-02T09:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing Map control causes map to freeze</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723674#M9120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what about navigation from page to page causes application to freeze issue?&lt;/P&gt;&lt;P&gt;the application contains 2 page one for map(offline) and the other contains normal controls when navigation from normal controls to map many times the application freeze.&lt;/P&gt;&lt;H1 style="font-size: 26px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/H1&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2015 10:30:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723674#M9120</guid>
      <dc:creator>HebaSaleh2</dc:creator>
      <dc:date>2015-09-03T10:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing Map control causes map to freeze</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723675#M9121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;is that issue same as &lt;A _jive_internal="true" href="https://community.esri.com/thread/164576"&gt;here&lt;/A&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2015 10:47:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723675#M9121</guid>
      <dc:creator>AnttiKajanus1</dc:creator>
      <dc:date>2015-09-03T10:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing Map control causes map to freeze</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723676#M9122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes it is the same issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2015 11:23:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/reusing-map-control-causes-map-to-freeze/m-p/723676#M9122</guid>
      <dc:creator>HebaSaleh2</dc:creator>
      <dc:date>2015-09-03T11:23:57Z</dc:date>
    </item>
  </channel>
</rss>

