旋转变换(storyBoard动画)属性路径问题



当为button设置property pathrotation transform时,我得到了error
-> 无法解析指定对象上的TargetProperty (UIElement.RenderTransform).(RotateTransform.Rotation) .

c#代码是->
Storyboard.SetTargetProperty(animation, new PropertyPath("(UIElement.RenderTransform).(RotateTransform.Rotation)"));

<Button x:Name="btn" Content="request" Click="btn_Click">
     <Button.RenderTransform>
               <RotateTransform CenterX="0" />
     </Button.RenderTransform>
</Button>

是路径错误还是其他什么,如果路径比正确的路径是什么?
由于

可以直接使用RotateTransform对象。在XAML中调用它,例如:

<Button x:Name="btn" Content="request" Click="btn_Click">
     <Button.RenderTransform>
               <RotateTransform x:Nam="BtnRotation" CenterX="0" />
     </Button.RenderTransform>
</Button>

后面的代码:

Storyboard.SetTarget(animation, BtnRotation);
Storyboard.SetTargetProperty(animation, new PropertyPath("CenterX"));

最新更新