4

I am developing an UWP 5.2.2 Windows 10 app. For a Raspberry PI 3 OS: 10.0.14393.576

I am using a direct copy of the code sample from MSDN quickstart-using-file-and-folder-pickers

I have added the pictures Library to the app manifest file Here is the code that I am using

private async void OpenFile_Click(object sender, RoutedEventArgs e)
{
    var picker = new Windows.Storage.Pickers.FileOpenPicker();
    picker.ViewMode = Windows.Storage.Pickers.PickerViewMode.Thumbnail;
    picker.SuggestedStartLocation =
        Windows.Storage.Pickers.PickerLocationId.PicturesLibrary;
    picker.FileTypeFilter.Add(".jpg");
    picker.FileTypeFilter.Add(".jpeg");
    picker.FileTypeFilter.Add(".png");

    Windows.Storage.StorageFile file = await picker.PickSingleFileAsync();
    if (file != null)
    {
        // Application now has read/write access to the picked file
        this.txtFileName.Text = "Picked photo: " + file.Name;
    }
    else
    {
        this.txtFileName.Text = "Operation cancelled.";
    }
}

The open file dialog never opens and 'file' is always 'null'. Thanks

CSDev
  • 3,177
  • 6
  • 19
  • 37
  • Have you tried `PickSingleFileAndContinue` ? – Furmek Jan 18 '17 at 02:53
  • @Furmek - PickSingleFileAndContinue is marked 'obsolete' by Microsoft and throws an exception 'Request is not supported' – spudtracktoad Jan 19 '17 at 00:06
  • It seems FileOpenPicker() not supported on Windows IoT core for now. Please check "[Universal APIs not functional in Windows 10 IoT Core](https://developer.microsoft.com/en-us/windows/iot/docs/unavailableapis)". – Rita Han Jan 19 '17 at 01:53
  • @Rita Han - Thanks, I will work on a different way of selecting a file. – spudtracktoad Jan 19 '17 at 03:00

0 Answers0