Skip to content

Instantly share code, notes, and snippets.

@nickdarnell
Last active July 27, 2018 06:09
Show Gist options
  • Select an option

  • Save nickdarnell/f54778ecdcc2cb97110d to your computer and use it in GitHub Desktop.

Select an option

Save nickdarnell/f54778ecdcc2cb97110d to your computer and use it in GitHub Desktop.
<ListBox>
<ListBox.Template>
<ControlTemplate TargetType="{x:Type ListBox}">
<Border x:Name="Bd" SnapsToDevicePixels="true"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="1">
<Grid>
<Image HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Stretch="None"
Source="RSS.png"
Margin="0,0,15,15"
Opacity="0.25">
</Image>
<ScrollViewer Padding="{TemplateBinding Padding}"
Focusable="false">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</ScrollViewer>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background"
TargetName="Bd"
Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
</Trigger>
<Trigger Property="IsGrouping" Value="true">
<Setter Property="ScrollViewer.CanContentScroll"
Value="false"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ListBox.Template>
</ListBox>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment