Created
February 16, 2015 21:04
-
-
Save angelobelchior/35cb9ff8b5dddb0bae24 to your computer and use it in GitHub Desktop.
Sketch Xamarin.Forms Easing
This file contains hidden or 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
// Sketch your next great idea! | |
using System; | |
using Xamarin.Forms; | |
var box = new BoxView(){Color = Color.Blue}; | |
var go = new Button(){ Text = "Go" }; | |
var back = new Button(){ Text = "Clear" }; | |
go.Clicked += (object sender, EventArgs e) => { | |
var position = new Rectangle(100, 100, 100, 100); | |
box.LayoutTo (position, 500, Easing.BounceIn); | |
}; | |
back.Clicked += (object sender, EventArgs e) => { | |
var position = new Rectangle(0, 0, 0, 0); | |
box.LayoutTo (position, 500, Easing.BounceOut); | |
}; | |
var layout = new StackLayout { | |
Children = { | |
box, | |
go, | |
back | |
} | |
}; | |
RootPage.Children.Add(new ContentPage { | |
Padding = new Thickness (0, 20, 0, 0), | |
Content = layout | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment