在 silverlight 中开始加载事件的故事板
我正在查看 Prism Stocktrader RI,我可以看到 InTransition Storyboard 是使用代码来播放的。我尝试了以下 xaml:
<UserControl.Triggers> <EventTrigger RoutedEvent="UserControl.Loaded"> <BeginStoryboard Storyboard="{StaticResource InTransition}"/> </EventTrigger> </UserControl.Triggers>But it gives the following error on InitializeComponent (i.e. a XamlParseException):
any idea why?
I am looking at the Prism Stocktrader RI and I can see that the InTransition Storyboard is played using code. I tried the following xaml:
<UserControl.Triggers>
<EventTrigger RoutedEvent="UserControl.Loaded">
<BeginStoryboard Storyboard="{StaticResource InTransition}"/>
</EventTrigger>
</UserControl.Triggers>
But it gives the following error on InitializeComponent (i.e. a XamlParseException):
any idea why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为触发器在 Silverlight 中不可用。
您可以使用 ControlStoryboardAction 行为在 xaml 中调用故事板,如下所示(您将需要 Microsoft.Expression.Interactions.dll 和 System.Windows.Interactivity.dll),
注意:您可以删除 EventName ='Loaded' 因为'Loaded' 是该控件的默认事件。
I think triggers are not available in Silverlight.
You can use a ControlStoryboardAction behavior to call a storyboard in xaml, like the following (you will need Microsoft.Expression.Interactions.dll and System.Windows.Interactivity.dll),
Note: you can remove EventName='Loaded' as 'Loaded' is the default event for this control.
通常对于此类错误,存在内部异常。请执行“查看详细信息”并为我们检查。
该错误通常意味着它无法正确解析资源,因此您可能需要查看
InTransition
是什么(如果这对您没有帮助,请发布)Usually for such errors there's an Inner Exception. Please do "View Detail" and check on that for us.
The error generally means it couldn't resolve the resource correctly, so you might need to look at what
InTransition
is (please post that if this doesn't help you)