PickAndContinue is the only method that will work on Windows Phone 8.1. This is not so weird and ugly, here is a simple example without ContinuationManager:
Suppose you want to select a .jpg file, you use FileOpenPicker:
FileOpenPicker picker = new FileOpenPicker(); picker.FileTypeFilter.Add(".jpg"); picker.ContinuationData.Add("keyParameter", "Parameter");
After running PickSingleFileAndContinue(); your application will be disconnected. When you finish collecting the file, the OnActivated event will be fired, where you can read the selected files:
protected async override void OnActivated(IActivatedEventArgs args) { var continuationEventArgs = args as IContinuationActivatedEventArgs; if (continuationEventArgs != null) { switch (continuationEventArgs.Kind) { case ActivationKind.PickFileContinuation: FileOpenPickerContinuationEventArgs arguments = continuationEventArgs as FileOpenPickerContinuationEventArgs; string passedData = (string)arguments.ContinuationData["keyParameter"]; StorageFile file = arguments.Files.FirstOrDefault();
Please note that when you start the file picker, your application is turned off, and in some rare cases it can be stopped by the OS (for example, small resources).
ContinuationManager is just an assistant that should make things easier. Of course, you can implement your behavior for simpler cases.
source share