FlexButton: A super flexible button control for Xamarin.Forms

Although Xamarin.Forms includes a Button control with quite a few ways to customize its layout, I needed a more flexible button for a side project, that required two things the default implementation could not deliver: A round shape and a way to catch when a user presses and releases the button and for how long. So I ended up with creating a new control and contribute it to the community.

What does it do differently?

The FlexButton control I wrote, supports events for different states, color overlays and adjustable shapes and paddings. You can define if you want text, an icon or both in your button, which color they should have in normal- and pressed state, which size, padding or border-radius it should have and more.

For more details, bug reports and feature request, please check out the GitHub Repository.You will also find a sample project to play around with.

If you want to use it in your projects, simply add the NuGet package to your Xamarin.Forms project and add the control to your XAML layout.

<flex:FlexButton xmlns:flex="clr-namespace:Flex.Controls;assembly=Flex" 
                 WidthRequest="76" 
                 HeightRequest="76" 
                 CornerRadius="38" 
                 HorizontalOptions="Center" 
                 Icon="lightbulb.png" 
                 ForegroundColor="#ffffff" 
                 HighlightForegroundColor="#49516F" 
                 BackgroundColor="#6279B8" 
                 HighlightBackgroundColor="#8EA4D2" 
                 TouchedDown="DemoButton_TouchedDown" 
                 TouchedUp="DemoButton_TouchedUp"/>