title: WPF - Access the parent Control from inside a Style Setter ControlTemplate
body: <p>When making controls non-amendable we display them as a <code>TextBox</code> to keep a consistent style. The problem is that a <code>ComboBox</code> can have any type of data so binding the <code>Text</code> property of the <code>ControlTemplate TextBox</code> is not as simple as using <code>SelectedItem</code>. </p>
  
  <pre><code>&lt;Style TargetType="{x:Type ComboBox}"&gt;
          &lt;Style.Triggers&gt;
              &lt;Trigger Property="IsReadOnly" Value="True"&gt;
                  &lt;Setter Property="Template"&gt;
                      &lt;Setter.Value&gt;
                          &lt;ControlTemplate&gt;
                              &lt;TextBox Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}, Path=????, Converter={StaticResource ResourceKey=ComboToTextConverter}, UpdateSourceTrigger=PropertyChanged}" /&gt;
                          &lt;/ControlTemplate&gt;
                      &lt;/Setter.Value&gt;
                  &lt;/Setter&gt;
              &lt;/Trigger&gt;
          &lt;/Style.Triggers&gt;
      &lt;/Style&gt;
  </code></pre>
  
  <p>The idea I have is to use a <code>Converter</code> and send the whole <code>ComboBox</code> so it can be handled by the <code>Converter</code> code. Is there anyway to do this?</p>
  
  <p>Any other suggestions are welcome!</p>