How to create a CheckBox with an Image

This code creates a CheckBox control with an Image as content in WPF and adds a Checked event handler.

<CheckBox Margin="8,12,12,0" Name="CheckBox1" FontSize="14"
    Checked="CheckBox1_Checked" Height="30" VerticalAlignment="Top"
    Foreground="Red">
    <Image Source="data\YourImageName.jpg" Height="30" Width="30"/>
</CheckBox>

Here is the code for Checked event handler.

private void CheckBox1_Checked(object sender, RoutedEventArgs e)
{
    CheckBox1.Content = "Checked";
}