Its about using PickSingleFileAndContinue. As i know its a bit different than the traditional PicksingleFileasync.
Here you have to suspend the app and continue after file choosing. In that page below is too much information for me. Can an Expert simply write a step-by-step manual for a single file selection please?
https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn614994.aspx
Sandesh KarkiPosted Mar 31, 2017, 3:21 AM
await RestoreStatusAsync(e.PreviousExecutionState);
if(rootFrame.Content == null)
{
rootFrame.Navigate(typeof(MainPage));
}
var continuationEventArgs = e as IContinuationActivatedEventArgs;
if (continuationEventArgs != null)
{
Frame scenarioFrame = MainPage.Current.FindName("pageName where fileopenpickeris used") as Frame;
if (scenarioFrame != null)
{
// Call ContinuationManager to handle continuation activation
continuationManager.Continue(continuationEventArgs, scenarioFrame);
}
}
Window.Current.Activate();
{
StorageFile file= args.Files[0];
}
Ilker MersinliogluPosted Mar 31, 2017, 2:58 AM
Sandesh KarkiPosted Mar 31, 2017, 1:02 AM
openPicker.FileTypeFilter.Add(".jpg");
openPicker.FileTypeFilter.Add(".jpeg");
openPicker.FileTypeFilter.Add(".png");
// Launch file open picker and caller app is suspended
// and may be terminated if required
openPicker.PickSingleFileAndContinue();