I try to create a list of buttons with two columns using a ListBox
and UniformGrid
. Everything seemed to be okay until I faced the following issue. The margin space of the button was shown with light blue color when I click it or hover over it. How to remove this effect?
This is my code:
<ListBox Width="1000" Grid.Row="1" VerticalAlignment="Top" VerticalContentAlignment="Top" Name="uniformGrid1" Margin="50" ItemsSource="{Binding SomeItemsList}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="2" Background="Transparent" Name="uniformGrid1"></UniformGrid>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Button Margin="50" Height="70" Click="keyword_Click" Width="250"
Foreground="Black" FontSize="16" FontFamily="Helvetica Neue" FontWeight="Bold"
BorderBrush="SlateGray" Content="{Binding Name}">
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="White" Offset="0.073" />
<GradientStop Color="White" Offset="1" />
<GradientStop Color="#FFE9E9F9" Offset="0.571" />
<GradientStop Color="#FFD7D7EC" Offset="0.243" />
</LinearGradientBrush>
</Button.Background>
</Button>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>