title: DataContext does not work using MVVM
body: <p>I have an AccView.xaml UserControl with following labels:</p>
  
  <pre><code>&lt;UserControl.DataContext&gt;
      &lt;vm:SetGetAccValues /&gt;
  &lt;/UserControl.DataContext&gt;
  
  &lt;Label x:Name="labelValX" Content="{Binding SensorAcc.X}" HorizontalAlignment="Left" Margin="282,51,0,0" VerticalAlignment="Top" FontSize="30" RenderTransformOrigin="0.519,0.24" Width="88" Height="44"/&gt;        
  &lt;Label x:Name="labelValY" Content="{Binding SensorAcc.Y}" Content="{Binding SensorAcc.Y}" HorizontalAlignment="Left" Margin="282,95,0,0" VerticalAlignment="Top" FontSize="30" RenderTransformOrigin="0.519,0.24" Width="88" Height="44"/&gt;       
  &lt;Label x:Name="labelValZ" Content="{Binding SensorAcc.Z}" HorizontalAlignment="Left" Margin="282,139,0,0"  VerticalAlignment="Top" Height="48" Width="88" FontSize="30" RenderTransformOrigin="0.759,0.459"/&gt; 
  </code></pre>
  
  <p>As shown in my xaml, I have declared the DataContext to a SetGetAccValues class: </p>
  
  <pre><code>public GetAccNotifications.Accelerometer SensorAcc { get; set; }    
  public bool SensorInitialiseringOK { get; set; }    
  public bool SensorOK { get { var Retval = SensorAcc != null &amp;&amp; SensorInitialiseringOK == true; return Retval; } }    
  public int SensorIndex { get; set; }
  
  public async Task InitializeAsync(GetAccNotifications.Readings readings, int serviceNumb)
  {
      if (!SensorOK)
      {
          var tagsAcc = await GetAccNotifications.Accelerometer.CreateAllAsync(GetAccNotifications.Readings.None, this);
          if (tagsAcc.Count &lt;= SensorIndex) return;
          SensorAcc = tagsAcc[SensorIndex].Sensor as GetAccNotifications.Accelerometer;
          SensorInitialiseringOK = SensorAcc != null &amp;&amp; tagsAcc[SensorIndex].NError == 0;
      }
      this.DataContext = this;
      if (SensorOK)
      {
          await SensorAcc.InitializeAsync(null, readings, this); 
      }
  } 
  </code></pre>
  
  <p>and I'm actually getting the X,Y and Z values from GetAccNotificaions.Accelerometer subclass (INotifyPropertyChanged), which I have declared to "SensorAcc". </p>
  
  <p>In this case, there might be a DataContext problem on following:</p>
  
  <pre><code>this.DataContext = this; 
  </code></pre>
  
  <p>since the values do not update in the View. I have also tried implementing exactly the same in the background class of AccView (AccView.xaml.cs) instead of defining the DataContext to this SetGetAccValues class and in this case, it works without any problem. I took some screenshot while debugging: </p>
  
  <p>AccView.xaml.cs case:</p>
  
  <p><img src="https://i.stack.imgur.com/ax185.png" alt="enter image description here"></p>
  
  <p>and in the SetGetAccValues.cs case, the three labels are not included in "this.DataContext". Is that the reason of the problem ?. If yes, how do I handle this ?, Do I have to include the InitializeComponent() method in this SetGetAccValues class as well ?. </p>