Created
June 23, 2012 02:47
-
-
Save mabster/2976454 to your computer and use it in GitHub Desktop.
Unfocused, Selected ListBoxItem Style
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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