What you’ll learn
- MVVM software pattern
- Xaml
- Animation domain
- Advanced functions of xamarin forms
This course includes:
- 12.5 hours on-demand video
- 4 articles
- 5 downloadable resources
- Access on mobile and TV
- Full lifetime access
- Certificate of completion
Description
The ViewExtensions class provides extension methods that can be used to build simple animations. This article shows how to create and cancel animations using the ViewExtensions class.
The ViewExtensionsclass provides the following extension methods that can be used to create simple animations:
- CancelAnimationscancel any animation.
- FadeToanima Opacity owned by a VisualElement.
- RelScaleTo applies an animated incremental increase or decrease to the Scalepropiety of a VisualElement.
- Rotate Toanima Rotation owned by a VisualElement.
- RelRotateTo applies an animated incremental increase or decrease to Rotation owned by a VisualElement.
- RotateXToanima the RotationX owned by a VisualElement.
- RotateYToanima la RotationY owned by a VisualElement.
- ScaleToanima the Scalepropiety of a VisualElement.
- ScaleXToanima the ScaleX owned by a VisualElement.
- ScaleYToanima the ScaleY owned by a VisualElement.
- TranslateToanima the TranslationXy TranslationY properties of a VisualElement.
The animation extension methods in the ViewExtensionsclass are all asynchronous and return a Task < pool > object. The return value is falsesi the animation is completed and truesi is canceled. Therefore, animation methods should normally be used with the awaitoperator, making it possible to easily determine when an animation has been completed. Also, then it is possible to create sequential animations with later animation methods running after the previous method has been completed. For more information, see Composite Animations.
If there is a requirement to allow an animation to be completed in the background, then awaitse can skip the operator. In this scenario, the animation extension methods will return quickly after starting the animation, with the animation in the background. This operation can be exploited by creating compound animations. For more information, see Composite Animations.
Rotation
The following code example demonstrates the use of the RotateTometodo to animate Rotation owned by an Image:
C # Dupdo
await image.RotateTo (360, 2000);
image.Rotation = 0;
This code animates the Imageinstance by rotating up to 360 degrees for 2 seconds (2000 milliseconds). The RotateTometodo gets the Rotationvalue of the current property for the start of the animation and then rotates from that value to its first argument (360). Once the animation is complete, the Rotation property of the image is reset to 0. This ensures that the Rotationproperty does not remain at 360 after the animation ends, which would avoid further rotations.
The following screenshots show the current rotation on each platform:
Who this course is for:
- C # Developers
How to Get this course FREE?
Get a 100% Discount On Udemy courses by clicking on the Apply Here Button. This Course coupon code is automatically added to the Apply Here Button.
Apply this Coupon: NAVIDADPRO is applied (For 100% Discount)
For Latest Udemy Courses Coupon, Join Our Official Free Telegram Group :https://t.me/freecourseforall
Note: The udemy Courses Will be free for a Maximum of 1000 Learners can use the promo code AND Get this course for 100% Free. After that, you will get this course at a discounted price.
Important Notice and Disclaimer:- CareerBoostZone platform is a free Job Sharing platform for all the Job seekers. We don’t charge any cost and service fee for any job which is posted on our website, neither we have authorized anyone to do the same. Most of the jobs posted over Seekajob are taken from the career pages of the organizations. Jobseekers/Applicants are advised to check all the details when they apply for the job to avoid any inconvenience.