我正在开发一个具有日志的WPF应用程序。日志是用listView设计的。当鼠标结束或选择项目时,listview项目最不会改变外观。我已经解决了这种风格为ListView:WPF:从ListViewItem删除突出显示效果
<Style x:Key="ItemContainerStyle1" TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Focusable" Value="False" />
</Trigger>
</Style.Triggers>
</Style>
这种风格固定我的问题,但提出了一个新的问题。当背景设置为“透明”时,现在我可以看到鼠标悬停在列表视图项目上时在下图中显示的悬停/光泽效果。
我试图用这样的尝试来解决这个问题,但没有运气。
<Style TargetType="{x:Type ListViewItem}">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#00000000"/>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="#00000000"/>
</Style.Resources>
</Style>
任何人都有一个想法如何消除这种恼人的悬停效应?
在此先感谢
谢谢,这解决了我的问题:)使用在这两天被! 我想知道如果你知道一本好书或一些好的主页可以获得有关造型的知识吗? – mskydt86 2013-05-11 08:40:31
只有[msdn](http://msdn.microsoft.com/en-US/),http://wpftutorial.net/和Google,对不起..也许别人有一个想法。 – Matmarbon 2013-05-11 09:07:18
FWIW,如果有人遇到这个人,他们也定义了自己的'ListView.ItemTemplate',则需要用' '替换'ControlTemplate'标签中的所有内容。 –
2015-10-07 16:40:13