0
Opacity属性我有一个ListViewItem的控制样式:错误,同时增加使用DoubleAnimation是
<EventTrigger RoutedEvent="ListViewItem.MouseEnter">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="BitmapEffect.Opacity"
From="0.0" To="1.0" Duration="0:0:0.5" AutoReverse="False" SpeedRatio="2" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="ListViewItem.MouseLeave">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="BitmapEffect.Opacity"
From="1.0" To="0.0" Duration="0:0:0.5" AutoReverse="False" SpeedRatio="2" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
我想,当鼠标在ListViewItem的,项目的边界慢慢出现,当鼠标离开它,边界效应消失, 但我得到这个错误,当鼠标都要离开项目:
Cannot resolve all property references in the property path 'BitmapEffect.Opacity'. Verify
that applicable objects support the properties.
注意的是,当我只用第一EventTrigger
其路由到ListViewItem.MouseEnter
,程序工作正确的!但它并不好看!
我在使用OuterGlowBitmapEffect!
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="BitmapEffect">
<Setter.Value>
<OuterGlowBitmapEffect GlowColor="SkyBlue" GlowSize="20" />
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="Black" />
</Trigger>
感谢您的答复,但本作淡出整个的ListViewItem的。我想淡出并淡入ListViewItem的BitmapEffect的不透明属性! 我之前尝试过这种方式 Storyboard.TargetProperty =“BitmapEffect.Opacity” 但我再次得到相同的错误! – Jalal 2010-07-23 09:16:17
我编辑了我的XAML,请检查。我不知道你使用的是什么位图效果。 – Ragunathan 2010-07-23 09:50:39
谢谢,但是这个也出现错误!我正在使用OuterGlowBitmapEffect。 – Jalal 2010-07-23 10:03:57