【问题标题】:rotation transform (storyBoard animation) property path issue旋转变换(故事板动画)属性路径问题
【发布时间】:2013-06-03 20:05:27
【问题描述】:

当为rotation transform 设置property pathbutton 时,我得到一个error
错误 -> 无法解析 TargetProperty (UIElement.RenderTransform)。 (RotateTransform.Rotation) 在指定对象上。

c#代码是->

Storyboard.SetTargetProperty(animation, new PropertyPath("(UIElement.RenderTransform).(RotateTransform.Rotation)"));

xaml 是 ->

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

是路径错误还是其他原因,如果路径不是正确的路径?
谢谢

【问题讨论】:

    标签: windows-phone-7 animation storyboard transformation


    【解决方案1】:

    您可以直接使用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"));
    

    【讨论】:

      猜你喜欢
      • 2013-06-05
      • 2019-02-06
      • 2019-04-15
      • 2021-12-29
      • 1970-01-01
      • 2012-07-09
      • 2012-02-21
      • 2011-10-03
      • 1970-01-01
      相关资源
      最近更新 更多