3

我想RenderTransformOrigin在 xaml 中进行修改storyboard。该值不得动画,立即更改也可以。以下代码不起作用:

<Storyboard x:Key="StoryboardFadeIn">
  <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransformOrigin).(Point.X)" Storyboard.TargetName="UserControl" To="0"/>
  <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransformOrigin).(Point.Y)" Storyboard.TargetName="UserControl" To="0"/>
</Storyboard>

是否可以在动画中更改此属性(仅使用 xaml)?

错误代码:

The property "X" is not a DependencyProperty. To be used in markup, non-attached properties must be exposed on the target type with an accessible instance property "X". 
4

1 回答 1

7

我不确定您是否可以使用 动画点结构的Xand ,但您应该能够使用 a动画YDoubleAnimationRenderTransformOriginPointAnimation

例子:

<Storyboard x:Key="StoryboardFadeIn">
    <PointAnimation Storyboard.TargetProperty="(UIElement.RenderTransformOrigin)" Storyboard.TargetName="UserControl" To="0,0"/>
</Storyboard>
于 2013-04-24T12:04:21.053 回答