title: How to allow usage of FilePicker in WindowsStore App?
body: <p>Using c#, Windows Store App, VS 2013</p>
  
  <p>Try to open File Picker, using next simple code:</p>
  
  <pre><code>    private async void OkBtnClick(IUICommand command)
      {
          if (this.EnsureUnsnapped())
          {
              FileOpenPicker fop = new FileOpenPicker();
              fop.FileTypeFilter.Add(".png");
              fop.FileTypeFilter.Add(".jpg");
              fop.FileTypeFilter.Add(".jpeg");
              fop.ViewMode = PickerViewMode.Thumbnail;
  
              fop.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
              StorageFile requestedFile = await fop.PickSingleFileAsync();
  
              if (requestedFile != null)
              {
               //TODO:
              }
          }
      }
  
      internal bool EnsureUnsnapped()
      {
          // FilePicker APIs will not work if the application is in a snapped state.
          // If an app wants to show a FilePicker while snapped, it must attempt to unsnap first
          bool unsnapped = ((ApplicationView.Value != ApplicationViewState.Snapped) 
              || ApplicationView.TryUnsnap());
          if (!unsnapped)
          {
              Extensions.NotifyUser("Cannot unsnap app...", statusNotificationBlock);
          }
  
          return unsnapped;
      }
  </code></pre>
  
  <p>Also add capability in appmanifest file for Pictures Library:</p>
  
  <p><img src="https://i.stack.imgur.com/EnwHr.png" alt="enter image description here"></p>
  
  <p>But during running got exception : <code>System.UnauthorizedAccessException</code> on line <code>StorageFile requestedFile = await fop.PickSingleFileAsync();</code>.</p>
  
  <p>Question: Why I got this exception if all required access provided, Also i try to launch VS2013 with Administrator rights - result - same.</p>
  
  <hr>
  
  <p>For creating this code use <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh771180.aspx" rel="nofollow noreferrer">this article</a></p>