title: Cast issue with CaptureFileAsync()
body: <p>I'm trying to figure out how to call windows camera UI from a windows form.</p>
  
  <p>I did this and it does compile:</p>
  
  <pre><code>Public Function ShootPicture() As StorageFile
      Dim captureUI As New CameraCaptureUI
      captureUI.PhotoSettings.Format = CameraCaptureUIPhotoFormat.Jpeg
      captureUI.PhotoSettings.AllowCropping = False
      Dim GetPhotoTask As Task(Of StorageFile) = captureUI.CaptureFileAsync(CameraCaptureUIMode.Photo)
      GetPhotoTask.Wait() ' Blocks current thread until CaptureFileAsync task completes'
      Dim result As StorageFile = GetPhotoTask.Result
      Return result
  End Function
  </code></pre>
  
  <p>But there is a 'System.InvalidCastException' execution error on .capturefileAsync() : type 'System._ComObject' cannot be casted as 'System.threading.tasks.task'</p>
  
  <p>Would anyone have any idea on how to fix this? Thanks</p>
  
  <p>If it can help here is the c# code translation:</p>
  
  <pre><code>public StorageFile ShootPicture()
  {
      CameraCaptureUI captureUI = new CameraCaptureUI();
      captureUI.PhotoSettings.Format = CameraCaptureUIPhotoFormat.Jpeg;
      captureUI.PhotoSettings.AllowCropping = false;
      Task&lt;StorageFile&gt; GetPhotoTask = captureUI.CaptureFileAsync(CameraCaptureUIMode.Photo);
      GetPhotoTask.Wait();
      // Blocks current thread until CaptureFileAsync task completes
      StorageFile result = GetPhotoTask.Result;
      return result;
  }
  </code></pre>