c# - Windows Phone- How to set LocalSettings first time? -
in desktop application or web projects projects there app.configs , web.configs files store settings. these settings set in development time (or whenever later) if occures, 1 time action.
in windows phone 8.1 xaml there isn't app.config file, developers able utilize windows.storage.applicationdata.current.localsettings
. nice.
how can set these settings first time (this means on first application run ever, can later read them , update existing values)? of course of study can set settings whenever run application time wasting. how set localsettings in applications first time? saw solution is there "first run" flag in wp7 don't think so, possibility.
var localsettings = windows.storage.applicationdata.current.localsettings; // create simple setting localsettings.values["examplesetting"] = "hello windows"; // read info simple setting object value = localsettings.values["examplesetting"]; if (value == null) { // no info } else { // access info in value } // delete simple setting localsettings.values.remove("examplesetting");
msdn reference
persistance of data
c# windows-phone-8
No comments:
Post a Comment