c# save data in local appdata code example
Example: uwp roaming data sample
ApplicationDataContainer roamingSettings = ApplicationData.Current.RoamingSettings;
roamingSettings.Values["lastViewed"] = DateTime.Now;
var lastViewed = (DateTime)roamingSettings.Values["lastViewed"];