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

AnimateProgressDouble

Mobile1.0

A passive animation that changes a double property, such as HeightRequest or Opacity, between the From and To values as a tracked value moves.

Properties

PropertyTypeDescription
FromdoubleThe value to use when Progress is at or below Minimum.
TodoubleThe 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:AnimateProgressDouble Property="HeightRequest"
                From="25"
                To="200"
                Progress="{Binding Path=Value, Source={x:Reference mySlider}}" />
        </BoxView.Behaviors>
    </BoxView>
</VerticalStackLayout>