public static void Load() { if (Settings.CurrentContainer.Values.ContainsKey(KEY_FILES)) { string content = Settings.CurrentContainer.Values[KEY_FILES] as string; InternalConfig = PortableConfigHelper.ReadConfig <FilesConfig>(content: ref content); Settings.CurrentContainer.Values[KEY_FILES] = content; InternalConfig.RecentFiles = InternalConfig.RecentFiles.Where(f => !string.IsNullOrWhiteSpace(f.Token)).ToList(); Save(); } else { InternalConfig = new FilesConfig(); Settings.CurrentContainer.Values[KEY_FILES] = PortableConfigHelper.WriteConfig <FilesConfig>(InternalConfig); } }
protected async override Task SetContent(string content) { SerializedCanvasCollection collection = PortableConfigHelper.ReadConfig <SerializedCanvasCollection>(content: ref content); int p = 1; foreach (SerializedCanvas ink in collection.Pages) { InkPage inkPage = new InkPage(p++); inkPage.PreloadedInk = ink; (this.DefaultViewModel["Pages"] as ObservableCollection <InkPage>).Add(inkPage); } for (int q = 0; q < 5; q++) { InkPage inkPage = new InkPage(p + q++); (this.DefaultViewModel["Pages"] as ObservableCollection <InkPage>).Add(inkPage); } }