Skip to content

Instantly share code, notes, and snippets.

@mabster
Created June 23, 2012 02:47
Show Gist options
  • Save mabster/2976454 to your computer and use it in GitHub Desktop.
Save mabster/2976454 to your computer and use it in GitHub Desktop.
Unfocused, Selected ListBoxItem Style
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<ListBox x:Name="foo">
<ListBox.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Orange" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Lime" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="Black" />
</ListBox.Resources>
</ListBox>
</Grid>
</Window>
// and in the ctor
foo.ItemsSource = new[]
{
"The quick",
"Brown fox",
"Jumps over",
"The lazy dog",
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment