O'Reilly logo

Xamarin Blueprints by Michael Williams

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Xamarin.Forms compound animations

Compound animations give you the ability to combine multiple animations as a storyboard. Let's replace the preceding function with our new implementation using a compound animation as follows:

private async Task AnimateFocalTarget(Point touchPoint) { _focalTarget.TintColorString = "#007F00"; var storyboard = new Animation(); var translationX = new Animation(callback: x => _focalTarget.TranslationX = x, start: touchPoint.X, end: touchPoint.X - (IMG_TARGET_BOUND / 2), easing: Easing.Linear); var translationY = new Animation(callback: y => _focalTarget.TranslationY = y, start: touchPoint.Y, end: touchPoint.Y - (IMG_TARGET_BOUND / 2), easing: Easing.Linear); var scaleFirst = new Animation(callback: o => _focalTarget.Scale ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required