【发布时间】:2011-12-30 12:38:36
【问题描述】:
我有一个带有一些 ListBoxItems 的 ListBox。每个 ListBoxItem 都包含一些文本和一个背景图像。当用户单击 ListBoxItem 时,我想在 ListBoxItem 顶部添加一个图像(它用一些额外的外观装饰该项目)。
我正在寻找一种将图像叠加到单击的 ListBoxItem 上的方法。这是我到目前为止的代码:
<ListBox Margin="0,34,0,25.113" Background="{x:Null}" BorderThickness="0">
<ListBoxItem Content="First Item" Height="71.96" Margin="0,10,0,0">
<ListBoxItem.Background>
<ImageBrush ImageSource="Untitled-4.png"/>
</ListBoxItem.Background>
</ListBoxItem>
</ListBox>
【问题讨论】:
标签: wpf listboxitem