I have a problem with Save and Load Settings in Universal Apps. I type this code:
enter class Setting
{
public static Kolor Read()
{
var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
byte _red = (byte)localSettings.Values["R"];
byte _green = (byte)localSettings.Values["G"];
byte _blue = (byte)localSettings.Values["B"];
return new Kolor(_red, _green, _blue);
}
public static void Save(Kolor kolor)
{
var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
localSettings.Values["R"] = kolor.R;
localSettings.Values["G"] = kolor.G;
localSettings.Values["B"] = kolor.B;
}
}
When I try to start apps, debuger show me NullReferenceException in:
enter byte _red = (byte)localSettings.Values["R"];
Someone can help me?