使用StaticResource时出错

时间:2009-09-29 12:41:49

标签: silverlight static-resource

我收到此错误

  

属性{StaticResource   StoryboardIntroAnimation}值已经出来   范围

当我尝试使用staic资源作为BeginStoryboard对象的Storyboard属性时。标记看起来有点像这样:

<UserControl ...>
   <UserControl.Resources>
      <Storyboard x:Key="StoryboardIntroAnimation">
         ...
      </Storyboard>
   </UserControl.Resources>

   <UserControl.Triggers>
        <EventTrigger>
            <EventTrigger.Actions>
                <BeginStoryboard Storyboard="{StaticResource StoryboardIntroAnimation}" />
            </EventTrigger.Actions>
        </EventTrigger>
    </UserControl.Triggers>

   ...
</UserControl>

有谁知道为什么会这样?

1 个答案:

答案 0 :(得分:0)

在EventTrigger上设置RoutedEvent?