I\'m trying to add a custom content to a button in Xamarin Forms.
By default Button is created like this:
Thanks Paul,
I have created my own UserControl which handles that
Here it is:
public partial class ContentButton : ContentView
{
public ContentButton()
{
InitializeComponent();
}
public event EventHandler Tapped;
public static readonly BindableProperty CommandProperty = BindableProperty.Create(c => c.Command, null);
public ICommand Command
{
get { return (ICommand)GetValue(CommandProperty); }
set { SetValue(CommandProperty, value); }
}
private void TapGestureRecognizer_OnTapped(object sender, EventArgs e)
{
if(Tapped != null)
Tapped(this,new EventArgs());
}
}
And view code: