I a'm running an uwp app on Rasbperry Pi 3 with Windows 10 IoT OS via Visual Studio Remote Machine and Release is selected. The problem is how to save settings I have made and use the same settings when run same UWP app later.
How is it done? I can read the settings from the text file from Windows.ApplicationModel.Package.Current.InstalledLocation; But of course I can't save any changes to the same text file. Where exactly should I put the text file if I wan't to save changes to text file?
But perhaps I can use this
Windows.Storage.ApplicationData.Current.LocalSettings;
But how do I check if there is no value stored and put instead an default value?
With this I am trying to save these settings it doesn't work. The point with this is that I can use these same settings when I run the same uwp app again.
var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
localSettings.Values["setting1"] = textBlockDelayValue.Text;
localSettings.Values["setting2"] = checkShow;
You can put the text file in
Windows.Storage.ApplicationData.Current.LocalFolder
of the solution and access it with this piece of code:You can read them out like this: