public async Task <StorageFile> SaveInFile() { var file = await TmpBaseFolder.CreateFileAsync(XmlDocName, CreationCollisionOption.ReplaceExisting); var strBdr = new StringBuilder(); using (var xw = XmlWriter.Create(new StringWriter(strBdr))) { var dataSer = new DataContractSerializer(typeof(List <CanvasData>)); dataSer.WriteObject(xw, Datas); XmlKeeping?.Invoke(xw); xw.Flush(); await FileIO.WriteTextAsync(file, strBdr.ToString()); } var imgfile = await TmpBaseFolder.CreateFileAsync(ImageFileName, CreationCollisionOption.ReplaceExisting); using (var fs = await imgfile.OpenAsync(FileAccessMode.ReadWrite)) { await SaveInStreamAsync(fs); await fs.FlushAsync(); } return(await Wrapper()); }
private async Task GetTmpSaveFolder() { TmpBaseFolder = await ApplicationData.Current.LocalCacheFolder.CreateFolderAsync(BaseFolderName, CreationCollisionOption.ReplaceExisting); TmpSaveBackgroundFolder = await TmpBaseFolder.CreateFolderAsync(TmpSaveBackgroundsFolderName, CreationCollisionOption.ReplaceExisting); TmpSaveLayersFolder = await TmpBaseFolder.CreateFolderAsync(TmpSaveLayersFolderName, CreationCollisionOption.ReplaceExisting); }