I have a XAML button control that looks like so:
<Button x:Name="my-button" Grid.Row="3" Content="See More Foo" Click="my-button_Click" Style="{StaticResource BlueButtonStyle}" Width="75" Height="23" HorizontalAlignment="Right" Margin="10,20,90,0" />
I'd like to change the style of the button in a C# method along the lines of:
public void ChangeButtonColor()
{
//Change the style attribute of my-button to RedButtonStyle
}
How would I go about accessing the XAML control in the C# code behind?
This is in a Silverlight 4.0 application.