WinRT manage application state with Radical
We have seen how to manage the navigation state using Radical now going wider is obviously possible to generally manage application state:
class SampleViewModel : AbstractViewModel
{
readonly ISuspensionManager suspensionManager;
public SampleViewModel( ISuspensionManager suspensionManager )
{
this.suspensionManager = suspensionManager;
this.suspensionManager.SetValue( "my-value-key", "may value", StorageLocation.Roaming );
var myValue = this.suspensionManager.GetValue<String>( "my-value-key" );
}
}
Grab a reference to the suspension manager and use it in a dictionary manner, notice that you can specify the storage location choosing among Roaming, as in the sample, and Local; using the Roaming storage local data are automatically shared across different instances of the same application running in different machines linked to the same Live ID account.
.m