title: Error: Must create DependencySource on same Thread as the DependencyObject even by using Dispatcher
body: <p>The following is part of my <code>View</code> in which I have bound an Image to a property in my <code>ViewModel</code>:</p>
  
  <pre><code>&lt;Image Source="{Binding Image}"  Grid.Column="2" Grid.ColumnSpan="2"/&gt;
  </code></pre>
  
  <p>My <code>ViewModel</code> is this:</p>
  
  <pre><code>public class MainWindowViewModel : INotifyPropertyChanged
  {
      public BitmapImage Image
      {
          get { return _image; }
          set
          {
              _image = value;
              OnPropertyChanged();
          }
      }
  
      Action _makeScannerAlwaysOnAction;
      private BitmapImage _image;
  
  
      public MainWindowViewModel()
      {
          AddNewPersonCommand = new RelayCommand(OpenFrmAddNewPerson);
          FingerPrintScannerDevice.FingerPrintScanner.Init();
          MakeScannerAlwaysOn(null);
      }
  
      private void MakeScannerAlwaysOn(object obj)
      {
          _makeScannerAlwaysOnAction = MakeScannerOn;
          _makeScannerAlwaysOnAction.BeginInvoke(Callback, null);
      }
  
      private void Callback(IAsyncResult ar)
      {
          FingerPrintScannerDevice.FingerPrintScanner.UnInit();
          var objFingerPrintVerifier = new FingerPrintVerifier();
          objFingerPrintVerifier.StartVerifingProcess();
          var ms = new MemoryStream();
          ms.Position = 0;
          objFingerPrintVerifier.MatchPerson.Picture.Save(ms, ImageFormat.Png);
          var bi = new BitmapImage();
          bi.BeginInit();
          bi.StreamSource = ms;
          bi.EndInit();
          Thread.Sleep(2000);
          Dispatcher.CurrentDispatcher.Invoke(() =&gt; Image = bi);
          //Image = bi;
  
          _makeScannerAlwaysOnAction.BeginInvoke(Callback, null);
      }
  
      private void MakeScannerOn()
      {
          while (true)
          {
              if (FingerPrintScannerDevice.FingerPrintScanner.ScannerManager.Scanners[0].IsFingerOn)
              {
                  return;
              }
          }
      }
  
      public event PropertyChangedEventHandler PropertyChanged;
  
      [NotifyPropertyChangedInvocator]
      protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
      {
          var handler = PropertyChanged;
          if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
      }
  }
  </code></pre>
  
  <p><strong>My Problem:</strong>
  The problem is when I want to bind the Image it gives me the error</p>
  
  <blockquote>
    <p>Must create DependencySource on same Thread as the DependencyObject</p>
  </blockquote>
  
  <p>I have googled a lot and I have seen the post in SO but neither of them worked for me.</p>
  
  <p>any kind of help would be very appreciated.</p>