在银色的灯光下
ListBoxItem
FocusVisualStyle
属性的错误。
为了实现你的目标,你需要提供一个新的模板
ListBoxItem项目
. 从Silverlight文档中可以找到默认模板
ListBox Styles and Templates
将ListBoxItem模板复制到静态资源中(App.Xaml将是一个好地方)
<ControlTemplate TargetType="ListBoxItem" x:Key="ListBoxItemSansFocus">
<!-- copy of the rest of the control template here -->
</ControlTemplate>
现在拆下
StoryBoard
VisualState
并移除名为“FocusVisualElement”的最后一个矩形。
ContainerStyle
物业外观like:-
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Template" Value="{StaticResource ListBoxItemSansFocus}" />
</Style>
</ListBox.ItemContainerStyle>