xamarin.forms.labs ImageButton issue

919 views Asked by At

I am using Xamarin.Forms and a Monodroid project.

I use Xamarin.Forms.Labs to render an ImageButton control.

Everytime I try to render the control in xaml I get this exception:

System.TypeInitializationException: An exception was thrown by the type initializer for Xamarin.Forms.Labs.Controls.ImageButton ---> System.MissingMethodException: Method 'BindableProperty.Create' was not found.

Here is the main code of my page:

    <ContentPage 
    xmlns="http://xamarin.com/schemas/2014/forms" 
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
    x:Class="*.MainPage"
    xmlns:controls="clr-namespace:Xamarin.Forms.Labs.Controls;assembly=Xamarin.Forms.Labs">
<ContentPage.Content>
    <controls:ImageButton HeightRequest="75" WidthRequest="175" ImageHeightRequest="50" ImageWidthRequest="50"  />

    </ContentPage.Content>

I intentionally removed the attributes to see if they were the reason of this exception.

1

There are 1 answers

0
IdoT On BEST ANSWER

You'll need to upgrade xamarin.forms.labs to xlabs.forms, as the authors changed the project structure completely.

More info about this upgrade can be found here