2
最好不使用后端代码?我正在寻找最干净的解决方案,使用2张图像淡入淡出悬停按钮。以下是我迄今为止如何在Silverlight中使用2个图像做简单的悬停按钮
编辑:
我得到了这部分工作..问题是,现在的鼠标移开似乎突然而鼠标悬停似乎罚款,我究竟做错了什么?
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation BeginTime="0:0:0" Duration="0:0:1" To="1"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="mouseOverImage" d:IsOptimized="True"/>
</Storyboard>
</VisualState>
<VisualState x:Name="MouseOut">
<Storyboard>
<DoubleAnimation BeginTime="0:0:0" Duration="0:0:1" To="0"
Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="mouseOverImage" d:IsOptimized="True"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed"/>
<VisualState x:Name="Disabled"/>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused"/>
<VisualState x:Name="Unfocused"/>
</VisualStateGroup>