title: RelativeSource works on (nested) sub-property, while ElementName does not
body: <p>The problem with the code below is: the binding to <code>SomeClassProp.SubTextProp</code> doesn't work (the source property is not being set to textbox content), while to <code>TextProp</code> it does.</p>
  
  <p>XAML:</p>
  
  <pre class="lang-mxml prettyprint-override"><code>&lt;Window x:Class="TestWPF.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          Title="MainWindow"
          Name="wMain"
          SizeToContent="WidthAndHeight"&gt;
      &lt;StackPanel&gt;
          &lt;TextBox Text="{Binding ElementName=wMain, Path=SomeClassProp.SubTextProp}" Width="120" Height="23" /&gt;
          &lt;TextBox Text="{Binding ElementName=wMain, Path=TextProp}" Width="120" Height="23" /&gt;
      &lt;/StackPanel&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>and the code:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public partial class MainWindow : Window
  {
      public SomeClass SomeClassProp { get; set; }
      public string TextProp { get; set; }
  
      public MainWindow()
      {
          InitializeComponent();
          SomeClassProp = new SomeClass();
      }
  }
  
  public class SomeClass
  {
      public string SubTextProp { get; set; }
  }
  </code></pre>
  
  <p>Am I missing something obvious here?</p>
  
  <p>Note that I need this binding to work from target (textbox) to source (class property).</p>
  
  <p><strong>UPDATE: When I change the binding from <code>ElementName=wMain</code> to <code>RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}</code> - BOTH bindings work. So the problem is specific to <code>ElementName</code> binding property.</strong></p>