title: C# + XAML - UI didn't get updated after changes
body: <p>I want to update my UI, but it didn't get updated, even when the <code>PropertyChanged</code> event got called. At startup i get the first values, but after changes it won't update.</p>
  
  <p>While Debugging, i can see, that the values getting updated and the <code>PropertyChanged</code> event got fired, but the getter didn't get called.</p>
  
  <p>(BTW: I'm relatively new to C#, respectively to the M-V-VM concept.)</p>
  
  <p><strong>XAML</strong></p>
  
  <pre><code>&lt;Page.DataContext&gt;
      &lt;vm:MainPageViewModel x:Name="ViewModel" /&gt;
  &lt;/Page.DataContext&gt;
  ...
  &lt;TextBlock x:Name="LatitudeVar" Text="{Binding LatitudeVar, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="79" Canvas.Left="189" Canvas.Top="38" /&gt;
  </code></pre>
  
  <p><strong>C# (MainPageViewModel)</strong></p>
  
  <pre><code>public class MainPageViewModel : ViewModelBase, INotifyPropertyChanged
  {
      private Session _session;
      public MainPageViewModel()
      {
          _session = Session.Instance;
      }
  
      public static readonly MainPageViewModel Instance = new MainPageViewModel();
  
      public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary&lt;string, object&gt; suspensionState)
      {
  
          // App just started, so we get GPS access and eventually initialize the client
          Session.InitializeClient();
          await StartGpsDataService();
          await Task.CompletedTask;
      }
  
      ...
  
      private string _latitude;
      public string LatitudeVar
      {
          get { return _session.Latitude; }
          set { _session.Latitude = value; NotifyPropertyChanged(); }
      }
  
      ...
  
      public async Task StartGpsDataService()
      {
          await Session.InitializeDataUpdate();
      }
  
       public new event PropertyChangedEventHandler PropertyChanged;
  
      [Annotations.NotifyPropertyChangedInvocator]
      protected virtual void NotifyPropertyChanged([CallerMemberName] string propertyName = null)
      {
          PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
      }
  </code></pre>
  
  <p><strong>C# (Session)</strong></p>
  
  <pre><code>public class Session : INotifyPropertyChanged
  {
      public static void InitializeClient()
      {
          MainPageViewModel mpvm = new MainPageViewModel();
          _mpvm = MainPageViewModel.Instance;
      }
  
      private static Session _instance;
      public static Session Instance
      {
          get
          {
              if (_instance == null)
              {
                  _instance = new Session();
              }
              return _instance;
          }
      }
  
  
      private static Session _sc;
      internal static Session Sc
      {
          get { return _sc; }
          set { _sc = value; }
      }
  
  
      private static MainPageViewModel _mpvm;
  
      private string _latitude;
      public string Latitude
      {
          get { return _latitude; }
          set
          {
              if (_latitude == value) return; _latitude = value; RaiseOnPropertyChanged("Latitude"); }
      }
  
      ...
  
       public void UpdateGpsData(Geopoint point, Geopoint geopointOld)
      {
          _mpvm.LatitudeVar = point.Position.Latitude.ToString();
      }
  
      public static async Task InitializeDataUpdate()
      {
         Sc = Session.Instance;
         Sc.StartTime = DateTime.Now;
         Sc.GetPosition(Geoposition.Coordinate.Point);
      }
  
      public new event PropertyChangedEventHandler PropertyChanged;
  
      [NotifyPropertyChangedInvocator]
      protected virtual void RaiseOnPropertyChanged([CallerMemberName] string propertyName = null)
      {
          PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
      }
  </code></pre>
  
  <p><strong>Some ways i tried before:</strong></p>
  
  <p><strong>C# (MainPageViewModel)</strong></p>
  
  <pre><code>private string _latitude;
  public string LatitudeVar
  {
      get { return _latitude; }
      set { _latitude = value; NotifyPropertyChanged("LatitudeVar"); }
  }
  </code></pre>
  
  <p><strong>Result</strong>: Values were not displayed.</p>
  
  <p><strong>C# (Session)</strong></p>
  
  <pre><code>public void UpdateGpsData(Geopoint point, Geopoint geopointOld)
  {
      Latitude = point.Position.Latitude.ToString();
  }
  </code></pre>
  
  <p><strong>Result</strong>: Values were diplayed at startup, but not updated. </p>
  
  <p>EDIT: Found a solution:
  Some code sorting, thanks for the hint ;) Now my Session.cs is a Model. All relavant methods are now in the ViewModel. And i took care of, that only one instance exists: </p>
  
  <pre><code>public MainPageViewModel()
  {
     _session = Session.Instance;
     _instance = this;
  }
  </code></pre>