title: View not updating properly with asynchronous queries? (MVVM, C#, WPF, NPGSQL)
body: <p>I have a very odd problem. Take the code below.I'm using NPGSQL to connect with a postgresql database. I simplified the code so that i could explain this problem easier. </p>
  
  <p>XAML</p>
  
  <pre><code>....
  &lt;TextBox x:Name="Countrytext" Text="{Binding Address.Country,
   Mode=TwoWay, Source={StaticResource EmployeeViewModel}}" 
  Grid.Row="7" Grid.Column="4" Grid.ColumnSpan="3"  MinHeight="10"  Height="20"/&gt;
  ....
  </code></pre>
  
  <p>WPF C#</p>
  
  <pre><code>cmd.CommandText = "SELECT name, surname FROM employee WHERE bsn = " + Employee.Bsn;
  using (var reader = cmd.ExecuteReader())
  {
    while (reader.Read())
    {
      Address.Country = "Something";
    }
  }
  
  cmd.CommandText = "SELECT country, postal_code FROM lives_at WHERE bsn = " + Employee.Bsn;
    using (var reader = cmd.ExecuteReader())
    {
      while (reader.Read())
      {                            
        Address.Country = "SomethingElse";
      }
     }
  </code></pre>
  
  <p>EDIT:
  Maybe the code of the Address model can add something to this question</p>
  
  <pre><code>  public class Address : INotifyPropertyChanged
  {
      private string country;
      public string Country
      {
          get { return country; }
          set
          {
              OnPropertyChanged("country");
              country = value;
  
          }
      }
  
      private string postalCode;
      public string PostalCode
      {
          get { return postalCode; }
          set
          {
              OnPropertyChanged("postalCode");
              postalCode = value;
  
          }
      }
  
      private string street;
      public string Street
      {
          get { return street; }
          set
          {
              OnPropertyChanged("street");
              country = value;
          }
      }
  
      private string number;
      public string Number
      {
          get { return number; }
          set
          {
              OnPropertyChanged("number");
              number = value;
          }
      }
  
      public Address()
      {
  
      }
  
  
      public event PropertyChangedEventHandler PropertyChanged;
  
      protected virtual void OnPropertyChanged(string propertyName)
      {
          PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
      }
  
  }
  </code></pre>
  
  <p>I'm using WPF. My view is bound the the viewmodel which contains this code. When i execute the code, the field in my viewmodel that is bound to Address.Country is set to "Something" instead of "SomethingElse". This confuses me because when i debug the program, Address.Country is actually set to "SomethingElse". Deleting 'Address.Country = "Something" Does not help. Why does this happen? </p>