title: Using FileOpenPicker with Silverlight
body: <p>Windows Phone 8.1 supports file open and file save pickers. I want to use a file open picker with a project which was converted form WP 8 to WP 8.1 (Silverlight).</p>
  
  <p>I can open the FileOpenPicker as follows:</p>
  
  <pre><code>FileOpenPicker picker = new FileOpenPicker();
  picker.FileTypeFilter.Add(".txt");
  picker.PickSingleFileAndContinue(); 
  </code></pre>
  
  <p>Now, all examples I have found use the new universal Windows runtime where the resulting files are catched as follows in the App.xaml.cs:</p>
  
  <pre><code>protected override void OnActivated(IActivatedEventArgs e) {     
      ContinuationActivatedEventArgs = e as IContinuationActivatedEventArgs; 
      if (ContinuationEventArgsChanged != null) 
      { 
          // Handle file here
      } 
  } 
  </code></pre>
  
  <p>The problem is that the converted Silverlight apps do not implement this method. Instead I derived the principle idea from another example for Silverlight apps (<a href="http://msdn.microsoft.com/en-us/library/dn655125%28v=vs.105%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/dn655125%28v=vs.105%29.aspx</a>):</p>
  
  <pre><code>private void Application_Activated(object sender, ActivatedEventArgs e)
  {
      var eventArgs = e as IContinuationActivatedEventArgs;
      if (eventArgs != null)
      {
          // Handle file here
      }
  }
  </code></pre>
  
  <p>But this does not work (e.g. <code>eventArgs</code> is always <code>NULL</code>).</p>
  
  <p>There is another example here: <a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/dn642086%28v=vs.105%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windowsphone/develop/dn642086%28v=vs.105%29.aspx</a>. This uses the following method in the app.xaml.cs:</p>
  
  <pre><code>private void Application_ContractActivated(object sender, IActivatedEventArgs e)
  {
          var filePickerContinuationArgs = e as FileOpenPickerContinuationEventArgs;
          if (filePickerContinuationArgs != null)
          {
          // Handle file here
          }
  }
  </code></pre>
  
  <p>But this method is never called in my app.</p>
  
  <p>Has someone a hint/idea how get the FileOpenPicker to work with a Silverlight WP8.1 app?</p>
  
  <p>Regards,</p>