WPF makes changing the appearance of individual ListBoxItems fairly simple if you know where to look. With the help of Expression Blend you can keep most of the default appearance and interactivity of a ListBoxItem and change only a few specific properties of your choosing. Just add a ListBoxItem to your project and right-click->Edit Control Parts(Template)->Edit a Copy… and then check out the XAML it creates or just visually edit it in Blend.
This example changes the currently selected item’s background into an image of a newt, with semi-transparent red text. This is applied through a ItemContainerStyle at the ListBox level and also includes an individual item which overrides that setting to reapply the default ListBoxItem style using {StaticResource {x:Type ListBoxItem}}. The image being applied is located in c:\temp (this allows it to run in XamlPad) and can be downloaded here.
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <Page.Resources> <Style x:Key="ListBoxItemHolyGrailStyle" TargetType="{x:Type ListBoxItem}"> <Setter Property="Background" Value="Transparent"/> <Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/> <Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/> <Setter Property="Padding" Value="2,0,0,0"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ListBoxItem}"> <Border SnapsToDevicePixels="true" x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"> <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> </Border> <ControlTemplate.Triggers> <Trigger Property="IsSelected" Value="true"> <Setter Property="Background" TargetName="Bd"> <Setter.Value> <ImageBrush ImageSource="c:\temp\Newt.png"/> </Setter.Value> </Setter> <Setter Property="Foreground" Value="#80F05050" /> </Trigger> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsSelected" Value="true"/> <Condition Property="Selector.IsSelectionActive" Value="false"/> </MultiTrigger.Conditions> <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> </MultiTrigger> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </Page.Resources> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="170"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <ListBox Margin="0,0,40,0" FontSize="24" IsSynchronizedWithCurrentItem="True" Grid.Column="0" ItemContainerStyle="{DynamicResource ListBoxItemHolyGrailStyle}" > <ListBoxItem Width="Auto" Height="Auto" Content="ClickMe"/> <ListBoxItem Width="Auto" Height="Auto" Content="Not a Newt" Style="{StaticResource {x:Type ListBoxItem}}"/> <ListBoxItem Width="Auto" Height="Auto" Content="Test"/> <ListBoxItem Width="Auto" Height="Auto" Content="Something"/> <ListBoxItem Width="Auto" Height="Auto" Content="Nothing"/> <ListBoxItem Width="Auto" Height="Auto" Content="Select"/> </ListBox> </Grid> </Page>
*If you should feel tempted to burn WPF as a witch, please take it from me that WPF weighs more than a duck and therefore will not float.