title: Xamarin Forms Binding Label Text not working
body: <p>I know that this had been answered multiple times before, and I've followed every possible guide.
  It doesn't work.</p>
  <p>Here is my code:</p>
  <p>XAML</p>
  <pre><code>&lt;Label Text=&quot;{Binding Path=StatusMessage, Mode=TwoWay}&quot;
         Margin=&quot;10,0,10,5&quot;
         VerticalOptions=&quot;End&quot;/&gt;
  </code></pre>
  <p>C#</p>
  <pre><code>    private string statusMessage;
      public string StatusMessage { 
          get { return statusMessage; }
          set
          {
              statusMessage = value;
              OnPropertyChanged(nameof(StatusMessage));
          }
      }
      
      public event PropertyChangedEventHandler PropertyChanged;
      protected void OnPropertyChanged(string propertyName)
      {
          PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
      }
  </code></pre>
  <p>The class extends <code>INotifyPropertyChanged</code> and to modify the label text I tried both
  <code>StatusMessage = &quot;Status: ...&quot;;</code>
  and
  <code>Device.BeginInvokeOnMainThread(() =&gt; { StatusMessage = &quot;Status: ...&quot;;});</code>.</p>
  <p>Nothing works.</p>
  <p>Any idea how to fix this mess?</p>
  <h2>EDIT</h2>
  <p>Adding <code>BindingContext = this;</code> as suggested in the main helped.</p>
  <p>Now it won't update the label from code called from a different thread, as follows</p>
  <pre><code>private void OnEnableUser(bool authenticated)
  {
      if (SynchronizationContext.Current != null)
      {
          [...]
      } else
      {
          Device.BeginInvokeOnMainThread(() =&gt;
          {
              OnEnableUser(authenticated);
          });
      }
  }
  </code></pre>