title: How to bind an element defined inside the control template for a custom control to a property defined in a subclass (of custom control class)
body: <p>I would like to bind an element inside a control template for a custom control to a property defined in a child class defined inside the custom control class. What might be the syntax for doing that (<code>see {Binding ???}</code>)?</p>
  
  <p>Some code...</p>
  
  <p>C# code:</p>
  
  <pre><code>public class CustmCntrl : Control
  {
    // blablabla
  
     public class SubChildClass: INotifyPropertyChanged
     {
          public double X { get; private set; }
          public string info { get; private set; }
     }
  }
  </code></pre>
  
  <p>XAML:</p>
  
  <pre><code>&lt;Style TargetType="{x:Type local:CustmCntrl}"&gt;
  
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type local:CustmCntrl}"&gt;
  
                  &lt;Grid&gt; ... &lt;/Grid&gt;
  
                  &lt;ItemsControl 
                         ItemsSource="{Binding stuffToDisplay, RelativeSource={RelativeSource TemplatedParent}}"&gt;
  
                         &lt;ItemsControl.ItemsPanel&gt;
                               &lt;ItemsPanelTemplate &gt;
                                   &lt;Grid&gt; ... &lt;/Grid&gt;
                               &lt;/ItemsPanelTemplate&gt;
                          &lt;/ItemsControl.ItemsPanel&gt;
  
                          &lt;ItemsControl.ItemTemplate&gt;
                               &lt;DataTemplate&gt;
                                    &lt;local:X
                                          ToolTip="{Binding info ???}"&gt;
                                          &lt;local:X.RenderTransform&gt;
                                              &lt;TranslateTransform X="{Binding X ???}"/&gt;
                                          &lt;/local:X.RenderTransform&gt;
                                    &lt;/local:X&gt;
                               &lt;/DataTemplate&gt;
                          &lt;/ItemsControl.ItemTemplate&gt;
                  &lt;/ItemsControl&gt;
  </code></pre>