memory leaks - navigating between pages Windows phone runtime -


let have 2 pages page1, , page2. when launch app, page 1 loading, can choose go page2. can go in page1. problem is, if page1->page2->page1 several times constructor of page2 called every time navigate on (i guess it's same page1), , more , more memory used. besides, if app suspended , resumed, resuming method called n-times page2 instantiated.

so there way avoid please ?

use page.navigationcachemode

by default, each navigation creates new instance of specific page subclass requested, , disposes previous page instance. happens when navigating visited page or when new page type same previous page type. apps involve frequent navigation same pages can cache , reuse page instances make navigation more efficient. this, set cachesize property specify how many pages cache. each page type want cache, must set page.navigationcachemode property either enabled or required. pages required cache mode cached regardless of cachesize value, , not count against cachesize total.

reference frame


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -