PhoneApplicationPage.State Property

July 28, 2014

Allows you to save transient state data on your page.

Namespace:  Microsoft.Phone.Controls
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)

public IDictionary<string, Object> State { get; }

Property Value

Type: System.Collections.Generic.IDictionary<String, Object>
Returns IDictionary<TKey, TValue>.Represents a generic collection of key/value pairs.

This property should not be used to store global state or store state that should be permanently saved, such as user data. The objects that the user places in this dictionary must be serializable. The state is accessible only during or after the OnNavigatedTo(NavigationEventArgs) method is called, or during or before the OnNavigatedFrom(NavigationEventArgs) method is called. If you implement it too early or too late, it will throw an exception. You should not use this property for excessive storage because there is a limit of 2 MB for each page and 4 MB for the entire application.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft