27. #if WINDOWS_APP
var result = VisualStateManager.GoToState(this, "Windows", false);
#elif WINDOWS_PHONE_APP
var result = VisualStateManager.GoToState(this, "WindowsPhone", false);
#endif
46. Phone アプリ – PFN 12345
roaming Local Temp
Windows アプリ – PFN 12345
roamingLocalTemp
Local
Cache
PFN 12345
ローミング
OneDrive stores up to 100kb of roaming
data per app (not included in user quota).
If app exceeds the limit, sync stops.
Sync engine transfers data
periodically based on
triggers (user idle, battery,
network, etc.)
Other clients are notified of
updated data via Windows
Notification Service. If app is
running when sync occurs, an
event is raised.
47. private void OnSuspending(object sender, SuspendingEventArgs e)
{
// TODO: Save application state and stop any background activity
ApplicationData.Current.RoamingSettings.Values["Hoge"] = model.Hoge;
ApplicationData.Current.RoamingSettings.Values["Foo"] = model.Foo;
}
// TODO: Load state from previously suspended application
model.Hoge = (bool?)ApplicationData.Current.RoamingSettings.Values["Hoge"] ?? false;
model.Foo = (double?)ApplicationData.Current.RoamingSettings.Values["Foo"] ?? 1.0;