Please login to access all of the features of the Community Site.

ThicknessAnimation

Mobile1.0

Animates the named property of the target, which must be a Thickness such as Margin or Padding, between two values.

Properties

PropertyTypeDescription
PropertystringThe name of the property to animate.
FromThicknessThe starting value. If not set, the property’s current value is used.
ToThicknessThe ending value.
TargetVisualElementThe element to animate.
DurationstringThe length of the animation in milliseconds. Defaults to 1000.
EasingEasingTypeThe easing curve to use: BounceIn, BounceOut, CubicIn, CubicInOut, CubicOut, Linear, SinIn, SinInOut, SinOut, SpringIn or SpringOut. Defaults to Linear.
DelayintHow long to wait before the animation begins, in milliseconds. Defaults to 0.
RepeatForeverboolRepeats the animation until it’s stopped. Defaults to false.

Example

Define the animation in the Resources of a parent element, then start it with a trigger or behavior. See Animations for the full setup.

<Rock:ThicknessAnimation x:Key="Demo"
    Target="{x:Reference myLabel}"
    Property="Margin"
    Duration="2000"
    To="15" />