xamarin.forms

24
Apr

Creating touch responsive (animated) button in Xamarin.Forms Android

Sometimes we would like to have a bit more user action responsivity when handling our apps. This post explains how to create tactile buttons in Xamarin.Forms using custom renderers to do so for Android.

First, we need a custom control that would represent our tactile button, so let’s create it.

Next, we would need to create a custom renderer class that would take care of button’s touch sensitivity.

To create the button pressed look and feel, in this example, we need to animate the button or to add a scale animation when button is pressed and un-scale when button is released. One of the ways to do that is to subscribe to button’s touch event. Implementing these overridden methods in your custom renderer takes care of subscribing and unsubscribing from the button’s touch event.

Finally, animating the button to have a little touch responsivity here comes down to scaling to a smaller size on mouse down, and returning to original size and launching command (if exists) on mouse up.

All you have to do now to start using these new buttons is to add them to your view!

Cheers!

15
Sep

FluentValidation with Dependency Injection and Inheritance for Xamarin Forms Mobile Application Validation

FluentValidation is a small validation library for .NET that uses a fluent interface and lambda expressions for building validation rules. Since input validation is important part of mobile applications, this library comes really handy as it is easy to setup and use. When developing for multiple platforms using Xamarin Forms it is desirable to have one validation codebase that could be used seamlessly for input validation on each platform.

Fluent validation is available through Nuget. We will add the package to one of our PCL projects.

Read more

6
Jul

How to Speed up Xamarin.Forms UI Development Process Using Xamarin Forms Player

If you are using Xamarin.Forms to develop a UI for your mobile app, then you probably feel crippled by the lack of a designer. It can take a couple of minutes when making a simple change in your XAML file until you can see your change in action on your favorite emulator or device. This lag is known to cause a lot of frustration for developers working on UI design and can negatively influence productivity.

Read more