I am trying to get rid of this white border around my buttons. I am adding an Image to a Button
. It does not seem to be the button itself, but the border of the image.
This is the XAML,
<Style x:Key="MyButton" TargetType="Button">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Name="border" BorderThickness="0" Background="{TemplateBinding Background}" CornerRadius="5" >
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" Value="0.5" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
And the Button
itsself,
<Button Name="Button2" Content="stuff" Height="25" Grid.Column="1" Grid.Row="1"
Style="{StaticResource MyButton}" Click="Button2_OnClick">
<Button.Background>
<ImageBrush ImageSource="Images\ButtonEnterLight.png"></ImageBrush>
</Button.Background>
</Button>
And this is the result,
What else do I need to do to get this to disappear? It has been bothering me for the last week.
EDIT: This is a Screen shot of the Live Visual Tree expanded to the first button that has an Image embedded in it.