【问题标题】:Actual/Current Value of a DoubleAnimation in SilverlightSilverlight 中 DoubleAnimation 的实际/当前值
【发布时间】:2023-04-07 09:51:01
【问题描述】:

我想获取 Silverlight 4.0 中动画属性的实际值

我想为 ScaleTransform ScaleX 属性设置动画,并在我停止情节提要时需要实际值。

我也试过这个:http://haishibai.blogspot.com/2010/09/siliverlight-on-windows-phone-7-get.html 但它没有用!

【问题讨论】:

  • 停止情节提要会将值重置为开始之前的值。

标签: c# silverlight animation storyboard


【解决方案1】:

我能够通过以下方式获得 RenderTransform 的当前 Rotation 属性

var x = needle.RenderTransform.GetValue(CompositeTransform.RotationProperty);

所以我猜你只是用ScaleXProperty替换RotationProperty

其中针 =

   <ed:RegularPolygon Name="needle" Height="81.5" InnerRadius="1" Canvas.Left="78" PointCount="3" Stretch="Fill" Stroke="Black" Canvas.Top="17.5" UseLayoutRounding="False" Width="15" Fill="#FFFFBB00" StrokeThickness="0" RenderTransformOrigin="0.5,0.838" >
            <ed:RegularPolygon.RenderTransform>
                <CompositeTransform Rotation="-140"/>
            </ed:RegularPolygon.RenderTransform>
        </ed:RegularPolygon>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-12-08
    • 2014-05-26
    • 1970-01-01
    • 2011-01-26
    • 1970-01-01
    • 2021-09-07
    • 2012-05-31
    • 2018-11-13
    相关资源
    最近更新 更多