在通用Windows平台中,有什么方法可以让页面保持活力吗?所以假设我输入了一个新客户,在某个时候我意识到我想要分配的类别还没有创建,所以我想导航到另一个页面来添加这个类别,但是我不希望当前的页面被破坏并丢失数据。在WPF中,这个场景在PRISM KeepAlive中非常简单。
谢谢
发布于 2015-09-15 09:13:59
您可以通过设置NavigationCacheMode属性来缓存页面及其内容。此属性的默认设置为Disabled,因此必须在构造函数中手动设置它:
public MyPage()
{
// The page will only be cached,
// if the cache size of the parent Frame is large enough for this page
NavigationCacheMode = NavigationCacheMode.Enabled;
// The page will always be cached,
// even if it exceeds the cache size of the parent Frame
NavigationCacheMode = NavigationCacheMode.Required;
}有关更多详细信息,请参阅MSDN上的Quickstart:在页面之间导航主题。
https://stackoverflow.com/questions/32581245
复制相似问题