-
-
Save anonymous/ed8bc8214d92691dc63e to your computer and use it in GitHub Desktop.
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
<ListBox.ItemContainerStyle> | |
<Style TargetType="{x:Type ListBoxItem}"> | |
<Setter Property="Template"> | |
<Setter.Value> | |
<ControlTemplate TargetType="{x:Type ListBoxItem}"> | |
<Border x:Name="Bd" | |
BorderBrush="{TemplateBinding BorderBrush}" | |
BorderThickness="{TemplateBinding BorderThickness}" | |
Background="{TemplateBinding Background}" | |
Padding="{TemplateBinding Padding}" | |
SnapsToDevicePixels="True"> | |
<StackPanel Orientation="Horizontal"> | |
<Rectangle x:Name="rect" | |
Fill="Red" | |
Height="5" | |
Width="5" | |
Visibility="Collapsed" /> | |
<TextBlock Text="{Binding Zulu}" /> | |
</StackPanel> | |
</Border> | |
<ControlTemplate.Triggers> | |
<Trigger Property="IsSelected" | |
Value="True"> | |
<Setter Property="Visibility" | |
TargetName="rect" | |
Value="Visible" /> | |
</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.InactiveSelectionHighlightBrushKey}}" /> | |
<Setter Property="Foreground" | |
Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}}" /> | |
</MultiTrigger> | |
<Trigger Property="IsEnabled" | |
Value="False"> | |
<Setter Property="Foreground" | |
Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" /> | |
</Trigger> | |
</ControlTemplate.Triggers> | |
</ControlTemplate> | |
</Setter.Value> | |
</Setter> | |
</Style> | |
</ListBox.ItemContainerStyle> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment