title: WPF UI update from a timer thread
body: <p>Within the App I display banners that rotate as time progresses or when user clicks next/previous.</p>
  
  <p>1) I need to update an UI element within <code>Timer.Elapsed</code> method. From what I found, it seems that timer ticks are executed on their own thread and element's dispatcher should be use to update the UI.</p>
  
  <pre><code>( (Image)BannerPanel.Content ).Dispatcher.Invoke( new Action( () =&gt; {
      ( (Image)BannerPanel.Content ).Source = GetImage( new Uri( banner.Uri, UriKind.Absolute ) );
  } ) );
  </code></pre>
  
  <p>but that throws an <code>InvalidOperationException</code>.</p>
  
  <p>2) The banner controller provides <code>Next</code> and <code>Previous</code> methods, which, when called display next/previous banner respectively. As <code>DisplayBanner</code> method tries to display banner and when the file is not found it tries to re-download it using <code>WebClient</code>'s <code>AsyncFileDownload</code> and on <code>DownloadComplete</code> it displays the image. Am I correct to assume that both, <code>Elapsed</code> fired by the timer and manual call of <code>Next</code>/<code>Previous</code> can occure at the same time, both being run on their own thread ( <code>Previous</code>/<code>Next</code> on UI thread and <code>Elapsed</code> on Timer thread ), possibly causing instability?</p>