private void LoadUserData() { var fn = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), $"{Id}_ud.json"); if (File.Exists(fn)) { UserData = LeseplanUserData.Load(File.ReadAllText(fn)); } else { UserData = new LeseplanUserData(); SaveUserData(); } }
private void ItemVMCheckedChanged(ItemVM item, bool chked) { if (UserData == null) { UserData = new LeseplanUserData(); } var key = item.Ref; if (!UserData.ReadItems.ContainsKey(key)) { UserData.ReadItems[key] = new ItemReadData { Ref = item.Ref }; } UserData.ReadItems[key].Checked = chked; SaveUserData(); }