Blend3时间轴执行命令 [英] Blend3 Timeline execute command
问题描述
你好
我有2个故事板,"转发"和"后退"。当"转发"时故事板已到达其最后一个关键帧,
i希望它执行C#:Backward.Begin();
i have 2 storyboards, "Forward" and "Backward". When the "Forward" storyboard has reached its last keyframe,
i want it to execute C#: Backward.Begin();
我需要不使用  ;"自动反转";选项。
I need to do it without using the "auto reverse" option.
任何想法如何?
ThanX
推荐答案
您可以在代码中执行此操作,或使用行为。
You could do this all in code, or use behaviors.
在代码中(未经测试):
In code (untested):
public MainPage()
{
// Required to initialize variables
InitializeComponent();
this.Forward.Completed +=new System.EventHandler(Forward_Completed);
}
private void Forward_Completed(object sender, System.EventArgs e)
{
this.Back.Begin();
}
使用行为:
1。将ControlStoryboardAction添加到设计图面中的对象
1. Add a ControlStoryboardAction to an object in the design surface
2。选择行为
3。在属性面板中,找到触发器部分,选择新建,选择StoryboardCompleted触发器
3. In the properties panel, find the trigger section, select new, select the StoryboardCompleted trigger
4。设置源和目标故事板
4. Set the source and target storyboards
xaml应该像这样(行为不必在任何特定对象上):
The xaml should like something like this (the behavior doesn't have to be on any particular object):
<Rectangle>
<i:Interaction.Triggers>
<im:StoryboardCompletedTrigger Storyboard="{StaticResource Forward}">
<im:ControlStoryboardAction Storyboard="{StaticResource Back}"/>
</im:StoryboardCompletedTrigger>
</i:Interaction.Triggers>
</Rectangle>
这篇关于Blend3时间轴执行命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!