title: WPF textblock binding question
body: <p>I'm trying to get my head around the whole MVVM thing and binding. I have a ViewModel class which has a property that is another class.  I want to bind to a (string) property of that class to the text of a textblock.</p>
  
  <p>I set the ViewModel as my data context for my window\page.  And then do this:</p>
  
  <pre><code>&lt;TextBlock Text="{Binding ElementName=myAddressClass, Path=StreetName}" /&gt;
  </code></pre>
  
  <p>But this does not work.  The text is empty.</p>
  
  <p>I can expose the StreetName directly as below and this works:</p>
  
  <pre><code>&lt;TextBlock Text="{Binding  Path=StreetName}" /&gt;
  </code></pre>
  
  <p>So am I doing something wrong in the first example.  It seems simple enough ... am I just confuse about what an elementname is or should be set to?</p>
  
  <p>thanks</p>