Xamanimation 1.3.0

.NET Standard 2.0
dotnet add package Xamanimation --version 1.3.0
NuGet\Install-Package Xamanimation -Version 1.3.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Xamanimation" Version="1.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Xamanimation --version 1.3.0
#r "nuget: Xamanimation, 1.3.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Xamanimation as a Cake Addin
#addin nuget:?package=Xamanimation&version=1.3.0

// Install Xamanimation as a Cake Tool
#tool nuget:?package=Xamanimation&version=1.3.0

Xamanimation - Animation Library for Xamarin.Forms

Xamanimation is a portable library designed for Xamarin.Forms that aims to facilitate the use of animations to developers. Very simple use from C# and XAML code.

We can define animations in XAML to a visual element when loading through a Behavior, use a trigger in XAML to execute the animation or from C# code.

Available animations:

  • Color
  • FadeTo
  • Flip
  • Heart
  • Jump
  • Rotate
  • Scale
  • Shake
  • Translate
  • Turnstile


To install Xamanimation, run the following command in the Package Manager Console.

PM> Install-Package Xamanimation

Animations directly from XAML

One of the main advantages of the library is the possibility of using animations from XAML. We must use the following namespace:


Let's animate a BoxView:

     Color="Blue" />

we can define animations directly in XAML (as Application or Page Resources):

     Target="{x:Reference FadeBox}"

Using the namespace of xamanimation, we have access to the whole set of animations of the library. In all of them there are a number of common parameters such as:

  • Target: Indicate the visual element to which we will apply the animation.
  • Duration: Duration of the animation in milliseconds.

Depending on the animation type used, we will have more parameters to customize the specific animation. For example, in the case of Fade Animation we will have an Opacity property to set how we modify the opacity.

To launch the animation we have two options:

  • Trigger: Called BeginAnimation that allows us to launch an animation when a condition occurs.
  • Behavior: We have a Behavior called BeginAnimation that we can associate to a visual element so that indicating the desired animation, we can launch the same when the element load occurs.

Using the Clicked event of a button we can launch the previous animation using the trigger provided:

          <EventTrigger Event="Clicked">
                    Animation="{StaticResource FadeToAnimation}" />

We also have the concept of Storyboard as a set of animations that we can execute over time:

     Target="{x:Reference StoryBoardBox}">
     <xamanimation:ScaleToAnimation  Scale="2"/>
     <xamanimation:ShakeAnimation />

Using C#

In the same way that we can use the animations of the library from XAML, we can do it from C# code. We have an extension method called Animate that expects an instance of any of the available animations.

If we want to animate a BoxView called AnimationBox:

     Color="Blue" />

Access the element, use the Animate method with the desired animation:

AnimationBox.Animate(new HeartAnimation());

Take control of the animation

You can control the duration of the animation using the Duration property. In addition to the type of Easing to use. Now, new properties have also been added such as:

Delay Add a delay before play the animation.

<img src="Media/xamanimation-delayed.gif" Width="250" />

Repeat Forever Now you can create infinite animations if you need it.

<img src="Media/xamanimation-repeat.gif" Width="250" />


Triggers allow you to start animations declaratively in XAML based on events or property changes.

        <Trigger TargetType="Entry" Property="IsFocused" Value="True">
                <xamanimation:AnimateDouble TargetProperty="Entry.FontSize" To="24"/>
                <xamanimation:AnimateColor TargetProperty="Entry.TextColor" To="Red"/>
                <xamanimation:AnimateColor TargetProperty="VisualElement.BackgroundColor" To="Yellow" Delay="1000"/>
                <xamanimation:AnimateDouble TargetProperty="VisualElement.Rotation" To="12" Duration="100"/>
                <xamanimation:AnimateDouble TargetProperty="{x:Static Entry.FontSizeProperty}" To="16"/>
                <xamanimation:AnimateColor TargetProperty="{x:Static Entry.TextColorProperty}" To="Black"/>
                <xamanimation:AnimateColor TargetProperty="{x:Static VisualElement.BackgroundColorProperty}" To="LightGray"/>
                <xamanimation:AnimateDouble TargetProperty="{x:Static VisualElement.RotationProperty}" To="0"/>

You can animate any property of type Int, Double, Color, Thickness or CornerRadius. Available options:

  • AnimateInt
  • AnimateColor
  • AnimateCornerRadius
  • AnimateDouble
  • AnimateThickness

Progress Animations

Sometimes you need to animate something based on a value that changes over time, for example as a a the result of a user interaction.

A common scenario is using a scroll. A parallax effect, etc.

    CornerRadius="24, 24, 0, 0">
            Progress="{Binding ScrollY, Source={x:Reference ScrollBehavior}}" 
            Progress="{Binding ScrollY, Source={x:Reference ScrollBehavior}}" 
            From="24, 24, 0, 0"

Available options:

  • AnimateProgressInt
  • AnimateProgressColor
  • AnimateProgressCornerRadius
  • AnimateProgressDouble
  • AnimateProgressThickness


Provides the animated transition behavior on controls when they first appear. You can use this on individual objects or on containers of objects. In the latter case, child elements will animate into view in sequence rather than all at the same time.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (3)

Showing the top 3 popular GitHub repositories that depend on Xamanimation:

Repository Stars
SmartHotel360 Mobile
A mobile app to track Xamarin news and explore all the goodness that is .NET for Mobile developers
Xamarin.Forms demo for 3 sessions presented at Microsoft Ignite 2019
Version Downloads Last updated
1.3.0 267,686 8/8/2019
1.2.0 58,957 9/13/2018
1.1.0 25,477 10/29/2017
1.0.0 11,612 12/18/2016