如何从代码隐藏调用故事板动作?
我是 Silverlight 新手。我有一个从网上翻转的动画,我也遵循了相同的步骤。它对我来说效果很好,并且正在尝试从代码隐藏中实现它。我该怎么做?
xmlns:TransitionBehaviours="clr-namespace:RMGUtils.RT.UI.Helpers.ShowHideTransition"
<Grid x:Name="DataGridBack">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown">
<TransitionBehaviours:ShowHideWithFlip ShowElementName="FrontFaceGrid" HideElementName="AlternateFaceGrid" Direction="BottomToTopCrazy" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Grid>
I'm new to Silverlight. I've got a animation for flip form the net and I followed the same step. It works fine for me and am trying to implement that from the codebehind. How can I do this?
xmlns:TransitionBehaviours="clr-namespace:RMGUtils.RT.UI.Helpers.ShowHideTransition"
<Grid x:Name="DataGridBack">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown">
<TransitionBehaviours:ShowHideWithFlip ShowElementName="FrontFaceGrid" HideElementName="AlternateFaceGrid" Direction="BottomToTopCrazy" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Grid>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以调用故事板 后面的代码如下
You can call a story board from code behind as follows
您在此处显示的代码实际上并不是故事板,而是触发器。拥有触发器的全部意义在于您不需要在后面编写任何代码来调用它。您可以将其附加到任何控件,例如,您可以将其附加到按钮并将 EventName 设置为 Click。
The code you are showing here is not really a storyboard but a trigger. The whole point of having a trigger is you don't need to write any code behind to call it. You can attach it to any controls, for example you can attach it to a button and set the EventName to Click.