WPF 访问资源中的Storyboard

<UserControl.Resources>
        <Storyboard x:Key="testStoryboard">
            <DoubleAnimation From="0" To="1" Duration="0:0:1"
                             Storyboard.TargetName="m_ScrollViewer"
                             Storyboard.TargetProperty="Opacity" />
        </Storyboard>
    </UserControl.Resources>


Code:

Storyboard story = (Storyboard)this.FindResource("testStoryboard");
story.Begin();

  

你可能感兴趣的:(WPF)