title: How can I have a WPF TextBlock that has the same size for all font weights?
body: <p>I'll jump to the chase: Is there any way to tell the WPF <code>TextBlock</code> to measure itself such that its size doesn't change when its <code>FontWeight</code> changes?</p>
  
  <p>I have a <code>TextBlock</code> that changes font weights dynamically based on a style.  The <code>TextBlock</code> is inside a <code>RadioButton</code> so it is Bold when checked, Normal otherwise:</p>
  
  <pre><code>&lt;Style x:Key="BoldWhenChecked" TargetType="RadioButton"&gt;
      &lt;Style.Triggers&gt;
          &lt;Trigger Property="IsChecked" Value="True"&gt;
              &lt;Setter Property="TextElement.FontWeight" Value="Bold" /&gt;
          &lt;/Trigger&gt;
      &lt;/Style.Triggers&gt;
  &lt;/Style
  </code></pre>
  
  <p>and here are the radio buttons themselves:</p>
  
  <pre><code>&lt;StackPanel Orientation="Horizontal"&gt;
      &lt;RadioButton Style="{StaticResource BoldWhenChecked}"&gt;
          &lt;TextBlock Text="Item 1" /&gt;
      &lt;/RadioButton&gt;
      &lt;RadioButton Style="{StaticResource BoldWhenChecked}"&gt;
          &lt;TextBlock Text="Item 2" /&gt;
      &lt;/RadioButton&gt;
      &lt;RadioButton Style="{StaticResource BoldWhenChecked}"&gt;
          &lt;TextBlock Text="Item 3" /&gt;
      &lt;/RadioButton&gt;
      etc...
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p>Unfortunately, since I am not using a fixed-width font the width of the <code>TextBlock</code> changes when the font weight changes, and the entire panel of radio buttons shifts accordingly, which is visually jarring.</p>