locked
Cache only in one NavigationDirection

    Question

  • Hey,

    I'd like to cache the page the user is on only if he navigates forward so when he navigates back to the page it's still cached.
    When he navigates back to the main page and on the page again it should not be cached anymore.

    Is there any way to achieve this?
    The tricks to clear the Cache like setting the CacheSize to 0 and back to its old value in the OnNavigatedFrom did not work for me.

    Yours sincerely,

    Stefan

    Thursday, April 30, 2015 7:01 PM

All replies

  • See this:

    NavigationCacheMode enumeration

    The NavigationCacheMode enumeration has these members.

    Member Value Description
    Disabled 0

    The page is never cached and a new instance of the page is created on each visit.

    Required 1

    The page is cached and the cached instance is reused for every visit regardless of the cache size for the frame.

    Enabled 2

    The page is cached, but the cached instance is discarded when the size of the cache for the frame is exceeded.


    I think you should use required.


    I sale myself ONLY half CNY!

    Friday, May 01, 2015 11:12 AM
  • I know the NavigationCacheMode enumeration...

    I don't want the page to always be cached but to be cached only if the navigationmode is back.
    If the user goes from page 1 to page2 it should not be cached.
    If he goes from page 2 to page 3 and back to page2 it should be cached.
    Friday, May 01, 2015 12:40 PM
  • Hi St3f4n,

    How about programmatically manipulate the BackStack property ?

    You should be able to cache the page that you want to cache.

    Basically you can always record the page navigation programmatically and add/remove some you need or don't want, then you can navigate to the correct page base on your own back stack. Also do not forget to handle GoBack() event.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, May 13, 2015 9:53 AM
    Moderator