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