title: WPF RadioButton Style using TextDecorations Underline
body: <p>I would like to change the style of the WPF RadioButton so that the Bullet is not shown, the text is bold when IsSelected is true, the text is not bold, underlined, and the cursor is the hand when IsSelected is false. I have it almost working but I can not get the text underlined. This is my XAML so far. </p>
  
  <pre><code>&lt;Style TargetType="{x:Type RadioButton}"&gt;
    &lt;Setter Property="Foreground" Value="DarkBlue" /&gt;
    &lt;Setter Property="Template"&gt;
      &lt;Setter.Value&gt;
        &lt;ControlTemplate TargetType="{x:Type RadioButton}"&gt;
          &lt;Border SnapsToDevicePixels="True"&gt;
            &lt;ContentPresenter VerticalAlighment="Center" /&gt;
          &lt;/Border&gt;
          &lt;ControlTemplate.Triggers&gt;
            &lt;Trigger Property="IsChecked" Value="True"&gt;
              &lt;Setter Property="TextBlock.FontWeight" Value="UltraBold" /&gt;
            &lt;/Trigger&gt;
            &lt;Trigger Property="IsChecked" Value="False"&gt;
              &lt;Setter Property="Cursor" Value="Hand" /&gt;
              &lt;Setter Property="TextBlock.TextDecorations" Value="Underline" /&gt;
            &lt;/Trigger&gt;
          &lt;/ControlTemplate.Triggers&gt;
        &lt;/ControlTemplate&gt;
      &lt;/Setter.Value&gt;
    &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>Any suggestions anybody could offer that could explain why the text of the RadioButton is not underlined when IsSelected is False would be greatly appreciated.</p>
  
  <p>Edit:
  OK based on the link provided I was able to change the Style to the following.</p>
  
  <pre><code>&lt;Style TargetType="{x:Type RadioButton}"&gt;
    &lt;Setter Property="Foreground" Value="DarkBlue" /&gt;
    &lt;Setter Property="Template"&gt;
      &lt;Setter.Value&gt;
        &lt;ControlTemplate TargetType="{x:Type RadioButton}"&gt;
          &lt;TextBlock x:Name="TextBlock" Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type RadioButton}}, Path=Content}" /&gt;
          &lt;ControlTemplate.Triggers&gt;
            &lt;Trigger Property="IsChecked" Value="True"&gt;
              &lt;Setter Property="TextBlock.FontWeight" Value="UltraBold" /&gt;
            &lt;/Trigger&gt;
            &lt;Trigger Property="IsChecked" Value="False"&gt;
              &lt;Setter Property="Cursor" Value="Hand" /&gt;
              &lt;Setter TargetName="TextBlock" Property="TextDecorations" Value="Underline" /&gt;
            &lt;/Trigger&gt;
          &lt;/ControlTemplate.Triggers&gt;
        &lt;/ControlTemplate&gt;
      &lt;/Setter.Value&gt;
    &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>Then to use a RadioButton with this style.</p>
  
  <pre><code>&lt;RadioButton Content"New" IsChecked="True" /&gt;
  &lt;RadioButton Content="Filter" /&gt;
  </code></pre>
  
  <p>This now shows two RadioButtons with no Bullet, its Content is Bold when IsSelected is true, and when IsSelected is false its not bold, underlined and shows the Hand cursor.</p>
  
  <p>My only comment now is if I am Binding the Text Property of a TextBlock to the Content property of a RadioButton would that fail if the Content of the RadioButton is something other then a String?</p>