Shr*_*key 1 .net silverlight styles blend
我正在研究控件的风格.我想在鼠标悬停完成后更改控件的borderthickness.我想在样式本身中编写它,而不是在代码隐藏中编写它
所以,我尝试了以下方式.
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="BorderThickness">
<SplineDoubleKeyFrame KeyTime="0" Value="2" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
Run Code Online (Sandbox Code Playgroud)
但这是一个错误.
我该如何实现此功能.
使用ObjectAnimationUsingKeyFrames
,而不是DoubleAnimationUsingKeyFrames
你的情况:
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="BorderThickness">
<DiscreteObjectKeyFrame KeyTime="0" Value="2"/>
</ObjectAnimationUsingKeyFrames>
Run Code Online (Sandbox Code Playgroud)
DoubleAnimationUsingKeyFrames
动画一个的值Double
属性,而BorderThickness
为类型的Thickness
,而不是Double
.
归档时间: |
|
查看次数: |
1299 次 |
最近记录: |