title: File Picker in Windows Phone 8.1
body: <p>I want to pick an image from my pictures album in windows phone 8.1 . For this I used this code but its gives error</p>
  
  <pre><code>private async void gallery_Tapped(object sender, TappedRoutedEventArgs e)
          {
              FileOpenPicker opener = new FileOpenPicker();
              opener.ViewMode = PickerViewMode.Thumbnail;
              opener.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
              opener.FileTypeFilter.Add(".jpg");
              opener.FileTypeFilter.Add(".jpeg");
              opener.FileTypeFilter.Add(".png");
  
              StorageFile file = await opener.PickSingleFileAsync();
              if (file != null)
              {
                  // We've now got the file. Do something with it.
                  var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
                  var bitmapImage = new Windows.UI.Xaml.Media.Imaging.BitmapImage();
                  await bitmapImage.SetSourceAsync(stream);
  
                  var decoder = await               Windows.Graphics.Imaging.BitmapDecoder.CreateAsync(stream);
                  MyImage.Source=bitmapImage;
              }
              else
              {
                  //OutputTextBlock.Text = "The operation may have been cancelled.";
              }
          }
  </code></pre>
  
  <p>Error </p>
  
  <p><img src="https://i.stack.imgur.com/jUrLr.png" alt="enter image description here"></p>