Storyboard.SetTarget vs Storyboard.SetTargetName

后端 未结 1 1334
我在风中等你
我在风中等你 2020-12-11 16:53

Why does Storyboard.SetTargetName works but Storyboard.SetTarget does not? Here xaml -

    
        

        
相关标签:
1条回答
  • 2020-12-11 17:32

    I found answer here! Why don't these animations work when I'm using a storyboard?

    Storyboard cant animate TranslateTransform, since it is not UIElement. This is how i do it now! :)

      Storyboard.SetTarget(doubleAnimation1, this.lastImage);
        Storyboard.SetTargetProperty(doubleAnimation1, new PropertyPath("RenderTransform.(TranslateTransform.X)"));
    
        Storyboard.SetTarget(doubleAnimation2, this.smartContent);
        Storyboard.SetTargetProperty(doubleAnimation2, new PropertyPath("RenderTransform.(TranslateTransform.X)"));
    
    0 讨论(0)
提交回复
热议问题