Skip to content

Instantly share code, notes, and snippets.

@angelobelchior
Created February 16, 2015 21:04
Show Gist options
  • Save angelobelchior/35cb9ff8b5dddb0bae24 to your computer and use it in GitHub Desktop.
Save angelobelchior/35cb9ff8b5dddb0bae24 to your computer and use it in GitHub Desktop.
Sketch Xamarin.Forms Easing
// 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