title: Accessing DependencyProperty: The calling thread cannot access this object because a different thread owns it
body: <p>I would like to load data into my WPF DataGrid when a DependencyProperty value changes. I thought something as simple as this would work but it does not;</p>
  
  <pre><code>public SQLiteDb.Attorney attorney
  {
      get { return (SQLiteDb.Attorney)GetValue(attorneyProperty); }
      set {
          SetValue(attorneyProperty, value);
          GetAttorneysIdentitiesAsync(); //Load the data here.
      }
  }
  public static readonly DependencyProperty attorneyProperty =
      DependencyProperty.Register("attorney", typeof(SQLiteDb.Attorney),
        typeof(AttorneyDetails), new PropertyMetadata(new SQLiteDb.Attorney()));
  </code></pre>
  
  <p>But I end up getting thread exceptions which I have very little experience about. The method <code>GetAttorneysIdentitiesAsync</code> looks like this which I guess is trying to access the property value from another thread.</p>
  
  <pre><code>public async void GetAttorneysIdentitiesAsync()
  {
      AlternativeIdentities = await SQLiteDb.db.Table&lt;SQLiteDb.AttorneyIdentity&gt;().Where(x =&gt; x.AttorneyId == attorney.Id).ThenBy(x =&gt; x.Id).Take(30).ToListAsync();
      AlternativeIdentitiesGrid.ItemsSource = AlternativeIdentities;
  }
  </code></pre>
  
  <p>I get the exception whenever I try to access the property from within the property class.</p>
  
  <pre><code>The calling thread cannot access this object because a different thread owns it.
  </code></pre>