Change an image during animation using storyboard

后端 未结 1 947
轻奢々
轻奢々 2021-02-08 05:10

I was looking for a way to change an Image during a storyboard, or more specifically, change the Source property of the image to point to a new image resou

相关标签:
1条回答
  • 2021-02-08 05:48

    Okay, solved it myself. Seems you have to use the ObjectAnimationUsingKeyFrames and DiscreteObjectKeyFrame as shown below:

    <ObjectAnimationUsingKeyFrames 
        BeginTime="00:00:00" 
        Storyboard.TargetName="image"
        Storyboard.TargetProperty="(Image.Source)">
        <DiscreteObjectKeyFrame KeyTime="00:00:00.7000000">
            <DiscreteObjectKeyFrame.Value>
                <BitmapImage UriSource="check_24.png" />
            </DiscreteObjectKeyFrame.Value>
        </DiscreteObjectKeyFrame>
    </ObjectAnimationUsingKeyFrames>
    
    0 讨论(0)
提交回复
热议问题