title: When is it allowable to call `BarcodeScanner.GetDefaultAsync()`?
body: <p>I am trying to use the new <a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.pointofservice.aspx" rel="nofollow">Windows 8.1 Point of Service API</a> for Barcode Scanners, and if I call <a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.pointofservice.barcodescanner.getdefaultasync.aspx" rel="nofollow"><code>GetDefaultAsync()</code></a> from any of the following locations, it returns <code>null</code>.</p>
  
  <ul>
  <li><code>App.OnLaunched</code></li>
  <li>The first page <code>.Loaded</code></li>
  <li>The first page <code>OnNavigatedTo</code></li>
  <li>The first page constructor</li>
  </ul>
  
  <p>This doesn't seem to be an issue with <code>DeviceCapabilities</code> or drivers, as it will work perfectly if I call it from:</p>
  
  <ul>
  <li>A button <code>Click</code> event handler</li>
  <li>The first page's <code>OnGotFocus</code></li>
  <li>The first page's constructor if wrapped in:<br/>
  <code>this.Dispatcher.RunIdleAsync(e =&gt;
  {
      var res = await BarcodeScanner.GetDefaultAsync();
      Assert(res != null);
  });</code></li>
  <li>Subsequent page's constructors</li>
  </ul>
  
  <p>Which makes me suspect that you must have focus to access the POS devices, and the constructor et al. are being called prior to focus being received.</p>
  
  <p><strong>Question:</strong> Is there published guidance as to <em>when</em> you can call <code>GetDefaultAsync()</code>?</p>