仅在一个NavigationDirection中缓存 [英] Cache only in one NavigationDirection

查看:77
本文介绍了仅在一个NavigationDirection中缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,

我想缓存用户所在的页面,只有当他向前导航时才这样,当他导航回到仍然缓存的页面时。 />
当他再次导航回主页面和页面时,它不应再被缓存了。

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.

有没有办法实现这个目标?

清除缓存的技巧就像将CacheSize设置为0并返回到OnNavigatedFrom中的旧值一样对我不起作用。



您诚挚的,

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

推荐答案

请参阅:

See this:

NavigationCacheMode
枚举

  NavigationCacheMode   枚举包含这些成员。

The NavigationCacheMode enumeration has these members.


页面永远不会被缓存,每次访问时都会创建一个新的页面实例。

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


页面被缓存,无论帧的缓存大小如何,每次访问都会重用缓存的实例。

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


页面被缓存,但是当超出帧的缓存大小时,将丢弃缓存的实例。

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.


这篇关于仅在一个NavigationDirection中缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆