为什么在DoubleAnimation之后无法修改TranslateTransform3D的OffsetX?

时间:2009-07-30 18:18:39

标签: wpf transform

我的代码在这里,运行此代码后我无法再编辑TranslateTransform3D的偏移属性:

                DoubleAnimation doubleAnimationX =
                    new DoubleAnimation(x,
                                        new Duration(TimeSpan.FromSeconds(second)));
                DoubleAnimation doubleAnimationY =
                    new DoubleAnimation(y,
                                        new Duration(TimeSpan.FromSeconds(second)));
                DoubleAnimation doubleAnimationZ =
                    new DoubleAnimation(z,
                                        new Duration(TimeSpan.FromSeconds(second)));
                                                     translate.BeginAnimation(TranslateTransform3D.OffsetXProperty, doubleAnimationX);
                                                     translate.BeginAnimation(TranslateTransform3D.OffsetYProperty, doubleAnimationY);
                                                     translate.BeginAnimation(TranslateTransform3D.OffsetZProperty, doubleAnimationZ);

1 个答案:

答案 0 :(得分:1)

TranslateTransform3D派生自Freezable。您的翻译在动画后被冻结,这使其不可变。