Saturday, October 20, 2012

Windows Phone Stateful Framework

For an windows phone application to pass the Microsoft certification, it must implement the tombstone state.

In concept this is easy to achieve, but in practice we must be careful.

This framework wraps the OnNavigatedTo and OnNavigatedFrom events of the page, exposing a set of methods one can override.

There are two types of methods: navigation methods and state manipulation methods.

The navigation methods allows the page to react to navigation events for initialization, clean-up, etc.

The state manipulation methods is where the code to persist and restore the state must be implemented.

A special state manipulation method is available for restoring the global state of the application.

The state can be immutable if it doesn’t change throughout the page life-cycle, or changeable if otherwise.

A page can be marked as transient this way optimizing the state manipulation methods.

For source code, please visit http://wpstatefulframework.codeplex.com/

No comments:

Post a Comment