title: Binding to an ancestor in WPF
body: <p>I have a window in one assembly that has a TextBlock control that I want to bind to the value of a Property of a class that is the property of the DataContext of that windows parent.  The class that is serving as the DataContext is only defined within the second assembly.  My question is what type do I need to specify as the Type in my binding statement. Can I just use the type of the DataContext's property that is common between the two assemblies or do I need to use the type of the DataContext?</p>
  
  <p>The below is a prototype of how I think it should work but since it isn't I am confused about something :)</p>
  
  <p><strong>Assembly #1</strong><br>
  Window  </p>
  
  <pre><code>&lt;TextBlock 
      Text="{Binding RelativeSource={RelativeSource 
          AncestorType={x:Type client:Client}}, Path=Name }"/&gt;
  </code></pre>
  
  <p><strong>Assembly #2</strong><br>
  Application Shell</p>
  
  <pre><code>class Shell 
  {
       public Client Client { get { return client; } set { client = value; } }
       OnStartup()
       {
            NavigationWindow window = new NavigationWindow();
            window.DataContext = this;
            window.Navigate(GetHomeView());
       }
  }
  </code></pre>