wilsonvargas / ButtonCirclePlugin

Circle Buttons with icon for your Xamarin.Forms Applications
MIT License
96 stars 18 forks source link

Icon NullReferenceException #24

Closed Croseven closed 6 years ago

Croseven commented 6 years ago

I have the following in XAML

<local:CircleButton WidthRequest="50" HeightRequest="50" x:Name="btnRegisterHorse" BorderColor="#1976D2" BackgroundColor="#1976D2" BorderRadius="20"></local:CircleButton>

and the following in CS btnRegisterHorse.Icon = "register_foul.png";

Then it causes my app to crash with the following StackTrace StackTrace.txt

wilsonvargas commented 6 years ago

This is not the correct way to show an image. If you want to show an image you must use the Image property like this:

btnRegisterHorse.Image = "register_foul.png";