首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Windows 8.1 RT ColorAnimation

Windows 8.1 RT ColorAnimation
EN

Stack Overflow用户
提问于 2016-02-11 21:51:40
回答 2查看 58关注 0票数 0

我得到了一个ControlTemplateTargetProperty="Button",它使用VisualStateManager,除了BitmapIcon.Foreground属性的ColorAnimation之外,一切都很正常。

我把它设置成这样:

代码语言:javascript
复制
<ColorAnimation Storyboard.TargetName="PART_Icon" 
                Storyboard.TargetProperty="(BitmapIcon.Foreground).(SolidColorBrush.Color)" 
                To="Green"
                Duration="0:0:0.100" />

我按下按钮什么都不会发生。对于给定的ColorAnimationsStoryBoard中的所有其他VisualState都是有魅力的。

将其设置为旧的方式是从代码背后的事件中产生的,但是它的代码很多。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-02-15 09:53:34

由于位图标的前台属性,上述代码的颜色动画来自于偶像元素类。

尝试以下代码:

代码语言:javascript
复制
<ColorAnimation Storyboard.TargetName="PART_Icon" 
            Storyboard.TargetProperty="(IconElement.Foreground).(SolidColorBrush.Color)" 
            To="Green"
            Duration="0:0:0.100" />

希望它能像魅力一样运作。:)

票数 0
EN

Stack Overflow用户

发布于 2016-02-15 10:01:17

EnableDependentAnimation设置为True

代码语言:javascript
复制
<ColorAnimation Storyboard.TargetName="PART_Icon" 
                Storyboard.TargetProperty="(BitmapIcon.Foreground).(SolidColorBrush.Color)" 
                To="Green"
                EnableDependentAnimation="True"
                Duration="0:0:0.100" />
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35350771

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档