- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 this document在描述 Windows 10 UWP 应用程序的生命周期时,它指出:
Users now expect your app to remember its state as they multitask on their device. For example, they expect the page to be scrolled to the same position and all of the controls to be in the same state as before. By understanding the application lifecycle of launching, suspending, and resuming, you can provide this kind of seamless behavior.
ApplicationData::Current->LocalSettings
. ApplicationData::Current->LocalSettings
我们是否可以避免被损坏或丢失的数据切断? TextBox->SelectionStart
获取光标位置,据我所知,在返回当前光标位置的这种用法的 API 中没有记录。这似乎很适合也存储为 int
进入 ApplicationData::Current->LocalSettings
. 最佳答案
App lifecyle您引用的文档已针对 Windows 10 进行了更新,但似乎丢失了您想知道的一些重要内容。
我找到了一篇旧博文,Managing app lifecycle so your apps feel "always alive" ,这似乎是您链接的灵感来源。
在博客文章中,末尾有一段内容是:
Save the right data at the right time
Always save important data incrementally throughout the life of your app. Because your app has only up to five seconds to run suspending event handler code, you need to ensure that your important app data has been saved to persistent storage by the time it is suspended.
There are two types of data for you to manage as you write your app: session data and user data. Session data is temporary data that is relevant to the user’s current experience in your app. For example, the current stock the user is viewing, the current page the user is reading in an eBook or the scroll position in a long list of items. User data is persistent and must always be accessible to the user, no matter what. For example, an in-progress document that the user is typing, a photo that was taken in the app or the user’s progress in your game.
how do you save and then restore a simple TextBox for resume from termination?
Once the minimum has been taken care of, next we'll probably need extras like cursor and window position.
how about the hard stuff, like undo history?
关于textbox - UWP/WinRT : How to save and then restore a simple TextBox for resume from termination?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31977234/
我是一名优秀的程序员,十分优秀!