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

AnimateProgressThickness

Mobile1.0

A passive animation that changes a Thickness property, such as Margin or Padding, between the From and To values as a tracked value moves.

Properties

PropertyTypeDescription
FromThicknessThe value to use when Progress is at or below Minimum.
ToThicknessThe value to use when Progress is at or above Maximum.
PropertystringThe name of the property to animate.
ProgressdoubleThe current value being tracked.
MinimumdoubleThe lowest value Progress is clamped to. Defaults to 0.
MaximumdoubleThe highest value Progress is clamped to. Defaults to 100.
EasingEasingTypeThe easing curve to use: BounceIn, BounceOut, CubicIn, CubicInOut, CubicOut, Linear, SinIn, SinInOut, SinOut, SpringIn or SpringOut. Defaults to Linear.

Example

Attach the animation to an element’s Behaviors and bind Progress to a value that changes, like a slider’s Value. See Animations for how passive animations work.

<VerticalStackLayout>
    <Slider x:Name="mySlider"
        Minimum="0"
        Maximum="100" />

    <BoxView Color="Blue"
        HeightRequest="100">
        <BoxView.Behaviors>
            <Rock:AnimateProgressThickness Property="Margin"
                From="0"
                To="20,20,10,10"
                Progress="{Binding Path=Value, Source={x:Reference mySlider}}" />
        </BoxView.Behaviors>
    </BoxView>
</VerticalStackLayout>