title: Xamarin Android with MVVMLight: Only the original thread that created a view hierarchy can touch its views
body: <p>I'm getting this error everytime I update a ViewModel property already binded in the activity. I know this error is related with update UI from another thread (not UI thread) but I can not control how MVVMLight do the binding...</p>
  
  <p>The activity:</p>
  
  <pre><code>private readonly List&lt;Binding&gt; _bindings = new List&lt;Binding&gt;();
  
  public PersonViewModel ViewModel
  {
      get
      {
          return App.Locator.Detail;
      }
  }
  
  private TextView _txtName;
  public TextView TxtName
  {
      get
      {
          return _txtName ??
              (_txtName = FindViewById&lt;TextView&gt;(Resource.Id.txtName));
      }
  }
  
  protected async override void OnCreate(Bundle savedInstanceState)
  {
      base.OnCreate(savedInstanceState);
      SetContentView(Resource.Layout.Detail);
  
      _bindings.Add(this.SetBinding(
          () =&gt; ViewModel.Person.Name,
          () =&gt; TxtName.Text));
  
      await Task.Factory.StartNew(() =&gt; { ViewModel.LoadDetailCommand.Execute(null); });
  }
  </code></pre>
  
  <p>The ViewModel:</p>
  
  <pre><code>private IDataService _dataService;
  
  private PersonObj _person; 
  public PersonObj Person
  {
      get
      {
          return _person;
      }
      set
      {
          Set(ref _person, value);
      }
  }
  
  private RelayCommand _loadDetailCommand;
  public RelayCommand LoadDetailCommand
  {
      get
      {
          return _loadDetailCommand
                 ?? (_loadDetailCommand = new RelayCommand(
                     async () =&gt;
                     {
                         await LoadDataAsync();
                     }));
      }
  }
  
  public PersonViewModel(IDataService dataService)
  {
      _dataService = dataService;
  }
  
  private async Task LoadDataAsync()
  {
      try
      {
          Person= await _dataService.GetPerson(0);
      }
      catch (Exception ex)
      {
          // Exception here!!
      }
  }
  </code></pre>