title: Override Control Template Property value in XAML
body: <p>I have a <code>ListBoxItem</code> template like below</p>
  
  <pre><code>&lt;Window.Resources&gt;
      &lt;Style TargetType="{x:Type ListBoxItem}"&gt;
          &lt;Setter Property="Padding"
                  Value="20" /&gt;
          &lt;Setter Property="Template"&gt;
              &lt;Setter.Value&gt;
                  &lt;ControlTemplate TargetType="{x:Type ListBoxItem}"&gt;
                      &lt;Border x:Name="Bd"
                              Padding="{TemplateBinding Padding}"&gt;
                          &lt;ContentPresenter /&gt;
                      &lt;/Border&gt;
                  &lt;/ControlTemplate&gt;
              &lt;/Setter.Value&gt;
          &lt;/Setter&gt;
      &lt;/Style&gt;
  &lt;/Window.Resources&gt;
  </code></pre>
  
  <p>In above sample <code>Padding</code> is 20 by default. So the <code>Border</code> control named <strong>Bd</strong> also gets the same value. So above resource will replace all the <code>ListboxIem</code> of <code>ListBox</code> in my window with the defined one. I have a specific <code>ListBox</code> which contains a <code>ToggleButton</code> also get the <code>Padding</code> value 20. My requirement is to make <code>Padding</code> value to 10 for this specific <code>ListBox</code> border. Could anyone please help me on this. Thanks in advance</p>
  
  <pre><code>&lt;ListBox Name="lb"&gt;
      &lt;ListBox.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;ToggleButton IsChecked="{Binding IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}}"&gt;
                  &lt;TextBlock x:Name="txt"&gt;
                          &lt;/TextBlock&gt;
              &lt;/ToggleButton&gt;
          &lt;/DataTemplate&gt;
      &lt;/ListBox.ItemTemplate&gt;
  &lt;/ListBox&gt;
  </code></pre>