如何使用 Expression Blend 在页面加载时自动播放故事板动画
我有一个故事板,应该在页面加载时播放。有没有办法直接从 Expression Blend 做到这一点?我宁愿不通过代码或 xaml 来完成它。
对按钮点击或其他事件做同样的事情怎么样?
谢谢
I've got a storyboard that should play when a page loads. Is there any way to do that directly from Expression Blend? I'd rather not do it through code or xaml.
What about doing the same for button clicks or other events?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将 ControlStoryboardAction 行为(Assets->Behaviors)拖到页面上,并将 EventName 设置为 PageLoaded,ControlStoryboardOption 设置为 Play,Storyboard 到你的故事板。
You can drag the ControlStoryboardAction behaviour (Assets->Behaviors) over to the Page, and set the EventName to be PageLoaded, and ControlStoryboardOption to Play, and Storyboard to your storyboard.
如果您决定通过代码执行此操作,那么您只需调用 StoryBoard 的 Begin() 即可。例如:
If you decide to do this via code then all you need to do is just to call Begin() of the StoryBoard. Like for example: