title: UWP. Trying to async download pictures and get System.Exception: Calling Async synchronously, 'marshalled for a different thread'
body: <p>if interface need a picture it saves request in </p>
  
  <pre><code>ConcurrentDictionary&lt;key, Delegate&gt; 
  </code></pre>
  
  <p>and when picture is on the disk read it and <code>SavedDelegate?.Invoke(key, byte[])</code>. 
  But there is an error in this place: </p>
  
  <pre><code>private async void OnDelegateInvokeAsync(ImageItem item, byte[] body)
  {
  ...
  item.Image = new BitmapImage();
  ...
  }
  </code></pre>
  
  <blockquote>
    <p>System.Exception: Calling Async synchronously, 'marshalled for a
    different thread' message (Exception from HRESULT: 0x8001010E
    (RPC_E_WRONG_THREAD))'</p>
  </blockquote>
  
  <p>What is the best way to resolve this problem?</p>