04 | State Management Bill Burrows | UW Faculty Member & VB MVP Anthony D. Green | Program Manager, Microsoft
Module Overview Application Life Cycle Saving/Restoring State AW State Management
Application Life Cycle
Application Lifecycle Running Not Running Suspended Suspending Resuming Activated
Application Lifecycle Running Not Running Suspended Suspending Resuming Activated Suspended When User switches away from it Windows enters low-power state May stay in memory Resumes very fast Windows manages – no code required (unless page is discarded from navigation path)
Application Lifecycle Running Not Running Suspended Suspending Resuming Activated Terminated (not running) When Application is suspended (and) Windows needs memory (or) Windows wants to save power Removed from memory Must be re-activated
Application Lifecycle Big Deal! Windows notifies your app when it suspends it, but doesn't provide additional notification when it terminates the app. That means your app must handle the suspended event and use it to save its state and release its exclusive resources and file handles immediately.
Application Lifecycle Running Not Running Suspended Suspending Resuming Activated Use the SuspensionManager
Suspending – Time Limited About 5 seconds! Save changes in state frequently while app is running to reduce activity when suspension takes place.
Types of States Application State: Deals with the entire application. An example is preferences. Page State: Deals with a specific page. Includes things like user-entered text, selected element in a list, etc.
Saving/Restoring State
Managing State
AW State Management
AW State Management
Module 4 Review Application Life Cycle Saving/Restoring State AW State Management