In my App i'm using a a FileSavePicker Contract (Provider). So other Apps could save files to my App. I implemented it, as it is shown on MSDN. The Problem now is, that i have to process a "saved" file, but how do i know, when the saving is completed? Here is my handler
private async void FileSavePickerUI_TargetFileRequested(FileSavePickerUI sender, TargetFileRequestedEventArgs args)
{
var deferral = args.Request.GetDeferral();
string saveFileName = sender.FileName;
StorageFolder fileSavePickerContractTempFolder = await ApplicationData.Current.LocalCacheFolder.CreateFolderAsync("FileSavePickerContract", CreationCollisionOption.OpenIfExists);
StorageFile fileSavePickerContractTempFile = await fileSavePickerContractTempFolder.CreateFileAsync(saveFileName, CreationCollisionOption.ReplaceExisting);
args.Request.TargetFile = fileSavePickerContractTempFile;
deferral.Complete();
}
Target of my app is the anniversary update (1607). After deferral.Complete() i Need to to more work with that file for integrating in my App. Can someone Point me in the right direction?
With the CacheFileUpdater i can react to the file, as soon it is written completely
On App.xaml.cs i override now the "OnCachedFileUpdaterActivated" Event, in which i can perform some Actions with the completely written file. So this works now as expected.
BUT! This does not work on Windows 10 Mobile, there the OnCachedFileUpdaterActivated EventHandler on App.xaml.cs gets not fired, why is this?