I have a series of ToggleButtons that have a style applied to them. I want to be able to change the background colour when a button is checked. Each ToggleButton is assigned to the same Checked event which has the following code.

Private Sub togAnswer_Checked(ByVal sender as Object, ByVal e as System.Windows.RoutedEventArgs)
'togAnswer was clicked....
Dim togC as ToggleButton
Dim togS as String = TryCast(sender, ToggleButton).Name.ToString()
'Cycle through all answers and set style
Dim bc = New BrushConverter()

For x = 1 to 3
    togC = DirectCast(FindName("togAnswer" &amp; x), ToggleButton) 

    If togS = "togAnswer" &amp; x.ToString Then
        'Set ToggleButton to selected colour
        togC.Background = DirectCast(bc.ConvertFrom("#AAFF8020"), Brush)
    Else    
        'Set other ToggleButtons to unselected colour
        togC.Background = DirectCast(bc.ConvertFrom("#AA000000"), Brush)
    End If
Next


End Sub

The code correctly identifies the source ToggleButton but does not change the color.

The style assigned to the ToggleButtons is...

&lt;Style x:Key="GlassToggleButton" TargetType="{x:Type ToggleButton}"&gt;
    &lt;Setter Property="FontSize" Value="24" /&gt;
    &lt;Setter Property="Foreground" Value="White" /&gt;
    &lt;Setter Property="Template"&gt;
        &lt;Setter.Value&gt;
            &lt;ControlTemplate TargetType="{x:Type ToggleButton}"&gt;
                &lt;Border x:Name="ToggleBorder" 
                    CornerRadius="0 15 0 15" 
                    Background="#AA000000"  
                    BorderBrush="#99FFFFFF"
                    RenderTransformOrigin="0.5,0.5"&gt;
                    &lt;Grid&gt;
                        &lt;Grid.RowDefinitions&gt;
                            &lt;RowDefinition Height="*"/&gt;
                            &lt;RowDefinition Height="1.7*"/&gt;
                        &lt;/Grid.RowDefinitions&gt;
                        &lt;Border Grid.Row="0" CornerRadius="0,14,0,0"&gt;
                            &lt;Border.Background&gt;
                                &lt;LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"&gt;
                                    &lt;GradientStop Color="#02FFFFFF" Offset="0"/&gt;
                                    &lt;GradientStop Color="#55FFFFFF" Offset="0.5"/&gt;
                                    &lt;GradientStop Color="#11FFFFFF" Offset="1"/&gt;
                                &lt;/LinearGradientBrush&gt;
                            &lt;/Border.Background&gt;
                        &lt;/Border&gt;
                        &lt;ContentPresenter x:Name="ToggleContentPresenter"
                            VerticalAlignment="Center"
                            HorizontalAlignment="Center"
                            Grid.RowSpan="2" /&gt;
                    &lt;/Grid&gt;
                &lt;/Border&gt;
                &lt;ControlTemplate.Triggers&gt;
                    &lt;Trigger Property="IsPressed" Value="True"&gt;
                        &lt;Setter Property="RenderTransform" TargetName="ToggleBorder"&gt;
                            &lt;Setter.Value&gt;
                                &lt;TransformGroup&gt;
                                    &lt;ScaleTransform ScaleX="0.95" ScaleY="0.95"/&gt;
                                &lt;/TransformGroup&gt;
                            &lt;/Setter.Value&gt;
                        &lt;/Setter&gt;
                        &lt;Setter Property="Background" Value="#AAFF8020" /&gt;
                    &lt;/Trigger&gt;
                    &lt;Trigger Property="IsChecked" Value="True"&gt;
                        &lt;Setter Property="Background" Value="#AAFF8020" /&gt;
                    &lt;/Trigger&gt;
                    &lt;Trigger Property="IsChecked" Value="False"&gt;
                        &lt;Setter Property="Background" Value="#AA000000" /&gt;
                    &lt;/Trigger&gt;
                    &lt;Trigger Property="IsChecked" Value="{x:Null}"&gt;
                        &lt;Setter Property="Background" Value="#AA000000" /&gt;
                    &lt;/Trigger&gt;
                &lt;/ControlTemplate.Triggers&gt;
            &lt;/ControlTemplate&gt;
        &lt;/Setter.Value&gt;
    &lt;/Setter&gt;
&lt;/Style&gt;


Thanks...


Question: Change Font Weight in Math Mode
Answer: With standard fonts you can switch to bold mathematics via \mathversion{bold}:



\documentclass{article}

\begin{document}

A mathematical test \( E = mc^2 \) and \( \int_0^1 \alpha(t)\,dt =
2\pi/3 \).  Here something that is already bold \(
\mathbf{x}\cdot\mathbf{y} = 1 \).

\mathversion{bold}

A mathematical test \( E = mc^2 \) and \( \int_0^1 \alpha(t)\,dt =
2\pi/3 \).  Here something that is already bold \(
\mathbf{x}\cdot\mathbf{y} = 1 \).

\end{document}


Alternatively consider using a different font set-up.  One is provided by the fourier package:



\documentclass{article}

\usepackage{fourier}

\begin{document}

A mathematical test \( E = mc^2 \) and \( \int_0^1 \alpha(t)\,dt =
2\pi/3 \).  Here something that is already bold \(
\mathbf{x}\cdot\mathbf{y} = 1 \).

\end{document}


Have a look at the LaTeX font catalogue for samples of other fonts with math support.