1
这是我ListView
项后,我作出一些改动:如何改变ListView的边界时,鼠标上并选择
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="White" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<Border
BorderBrush="White"
BorderThickness="0"
Background="{TemplateBinding Background}">
<GridViewRowPresenter HorizontalAlignment="Stretch"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Width="Auto" Margin="0" Content="{TemplateBinding Content}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.ItemContainerStyle>
Background color
是Transparent
和Foreground color
为White
。
虽然MouseOver
或ListView item selected
什么都没有改变,这意味着当期的观点没有改变,我想在MouseOver
的BorderColor
更改为White
,虽然Selected
我想改变BorderColor
蓝色。
编辑:
尝试后的代码示例这2条线:
<Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Background}"/>
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Border}"/
收到错误的资源Item.SelectedActive.Bachground无法解析和资源Item.SelectedActive.Border不能解决。
请参阅我的更新后,尝试你的代码 –
我修改和更新我的代码。请现在尝试它的工作确定 – ReeganLourduraj
现在收到的资源FocusVisual无法解析该行Setter Property =“FocusVisualStyle”Value =“{StaticResource FocusVisual}”/> - 这是什么意思? –