Automatic State Preservation Inner Workings

This section looks at how the state preservation system works behind the scenes. You see how properties decorated with the Stateful attribute are identified and how delegates for property accessors are created to store and retrieve property value. You also see how a custom ViewState class is used to load and save state via the ViewModelBase class.

The following sections are advanced in nature. Feel free to skip ahead. If you choose to use the custom state preservation system, you may return to this chapter at a later time.

Identifying Stateful ViewModels

The custom IStatePreservation interface is implemented by viewmodels that want to save and restore state. If a viewmodel implements IStatePreservation ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.