문제

In Android, you can store user's config in "preferences" file. So where should the "preferences" being stored in a Metro app and how can this be accomplished?

Any example will help. Examples in Javascript would be the best.

도움이 되었습니까?

해결책

You can use Windows.Storage.ApplicationData for this.

Example:

var applicationData = Windows.Storage.ApplicationData.current;

var userSetting= applicationData.localSettings.values.userSetting;

//First run ? set default value
if (userSetting) == "undefined"){
    applicationData.localSettings.values.userSetting= 1; 
}

You can also take a look at the Sample SDK app

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top