Last active
June 30, 2018 22:49
-
-
Save juucustodio/24311fbf484a351bfc0a60df04c45f5a to your computer and use it in GitHub Desktop.
Example of how to implement animations in Xamarin.Forms applications - http://julianocustodio.com/animations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:local="clr-namespace:PlayGroundDemo" | |
xmlns:xamanimation="clr-namespace:Xamanimation;assembly=Xamanimation" | |
x:Class="PlayGroundDemo.MainPage"> | |
<ContentPage.Resources> | |
<ResourceDictionary> | |
<xamanimation:StoryBoard | |
x:Key="LogoAnimation" | |
Target="{x:Reference Logo}"> | |
<xamanimation:TranslateToAnimation TranslateY="180" TranslateX="95" Duration="750" /> | |
<xamanimation:TranslateToAnimation TranslateY="-180" TranslateX="-95" Duration="750" /> | |
<xamanimation:TranslateToAnimation TranslateY="0" TranslateX="0" Duration="750" /> | |
</xamanimation:StoryBoard> | |
</ResourceDictionary> | |
</ContentPage.Resources> | |
<ContentPage.Content> | |
<StackLayout> | |
<Image x:Name="Logo" Source="logo.png" VerticalOptions="CenterAndExpand"/> | |
<Button Text="Start Animation" VerticalOptions="End"> | |
<Button.Triggers> | |
<EventTrigger Event="Clicked"> | |
<xamanimation:BeginAnimation Animation="{StaticResource LogoAnimation}" /> | |
</EventTrigger> | |
</Button.Triggers> | |
</Button> | |
</StackLayout> | |
</ContentPage.Content> | |
</ContentPage> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment