title: Unable to override TextBlock Style in XAML
body: <p>I have this in the ResourceDictionary, defining a style on application level:</p>
  
  <pre><code>&lt;Style x:Key="TextBlockStyle" TargetType="TextBlock"&gt;
      &lt;Setter Property="Margin" Value="0,10,0,10"/&gt;
  &lt;/Style&gt;
  &lt;Style TargetType="TextBlock" BasedOn="{StaticResource TextBlockStyle}" /&gt;
  </code></pre>
  
  <p>I want to remove the Margins for a particular TextBlock, which is inside the xctk:PropertyGrid control (from the Extended WPF Toolkit). If i just change the numbers in the ResourceDictionary style above, it works.</p>
  
  <p>Now I'm trying to override the PropertyGrid's style in the specific window XAML instead of the global styles.</p>
  
  <pre><code>&lt;xctk:PropertyGrid&gt;
      &lt;xctk:PropertyGrid.Resources&gt;
          &lt;Style TargetType="TextBlock"&gt;
              &lt;Setter Property="Margin" Value="0,0,0,0"/&gt;
          &lt;/Style&gt;
      &lt;/xctk:PropertyGrid.Resources&gt;
  &lt;/xctk:PropertyGrid&gt;
  </code></pre>
  
  <p>Unfortunately, this doesn't work, the TextBlock in the PropertyGrid is unchanged, keeping the global style.</p>
  
  <p>UPDATED:</p>
  
  <p>The xtck:PropertyGrid has an xctk:WatermarkTextBox inside it. The WatermarkTextBox has this inside:</p>
  
  <pre><code>&lt;ContentPresenter x:Name="PART_WatermarkHost" Content="{TemplateBinding Watermark}"
      ContentTemplate="{TemplateBinding WatermarkTemplate}"
      VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
      HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
      isHitTestVisible="False"
      Margin="{TemplateBinding Padding}"
      Visibility="Collapsed" /&gt;
  </code></pre>
  
  <p>It is this ContentPresenter, which apparently produces the TextBlock in question.</p>
  
  <ol>
  <li><p>The style in the ResourceDictionary gets applied to it, changing the margin.</p></li>
  <li><p>But my style inside  doesn't override it.</p></li>
  </ol>
  
  <p>How would I do that?</p>