title: Apply a WPF style to a Border within a UserControl
body: <p>I have a very simple UserControl, which just consists of a TextBlock contained within a Border element.</p>
  
  <p>Is there a way of applying a style to the TextBlock within the UserControl from the containing window.</p>
  
  <p>I know that I can create a style with..</p>
  
  <pre><code>&lt;Style TargetType='TextBlock'&gt;
  </code></pre>
  
  <p>But this applies to all TextBlocks within my window, not just the ones inside my UserControl</p>
  
  <p>So I want to be able to say something like...</p>
  
  <pre><code>&lt;Style TargetType='MyUserControl.TextBlock'&gt;
  </code></pre>
  
  <p>Thanks,</p>
  
  <p>Rich.</p>
  
  <p>PS. this is a simplified example of what I'm trying to do!</p>
  
  <h2>ADDITIONAL NOTE</h2>
  
  <p>As I was driving home this evening, this was rattling around inside my head, and I thought of a possible solution.. and that's to create a basic sub-class of the TextBlock control, and call it MyTextBlock.. so just have a definition like</p>
  
  <pre><code>public class MyTextBlock : TextBlock { }
  </code></pre>
  
  <p>Then, within the usercontrol, use 'MyTextBlock' rather than 'TextBlock'. This will allow me to apply a style to a type of 'MyTextBlock'. Bingo !!!</p>
  
  <p>Maybe this isn't the tidiest way of doing this, but it's very little code, and it works.</p>
  
  <p>However, as I'm fairly new to WPF, I'm quite interested in a more standard way of acheiving this.</p>