3

im using circleImage

xmlns:ic="clr-namespace:ImageCircle.Forms.Plugin.Abstractions;assembly=ImageCircle.Forms.Plugin.Abstractions"

in my xaml file.

and what i'm trying to do is inserting

<ic:CircleImage 
    x:Name="userProfileImage"
    HeightRequest="50"
    WidthRequest="50"
    Aspect="AspectFill"
    Source="{Binding post.uploader.userProfile.userThumbnail}"
/>

this image under the button property.

but if i do this(under)

<Button Clicked="OnUserInfoClicked">
    <Button.Image>
        <ic:CircleImage 
            x:Name="userProfileImage"
            HeightRequest="50"
            WidthRequest="50"
            Aspect="AspectFill"
            Source="{Binding post.uploader.userProfile.userThumbnail}"
        />
    </Button.Image>
</Button>

then, i get this error.

No property, bindable property, or event found for 'image'

what am i doing wrong? and how to fix it?

softmarshmallow
  • 725
  • 2
  • 10
  • 28

1 Answers1

2

What you are trying to do is not possible. However if all you wanna do is be able to click on the image and perform an action, why don't you just use a TapGesture?

<ic:CircleImage 
    VerticalOptions="Center"
    x:Name="userProfileImage"
    HeightRequest="50"
    WidthRequest="50"
    Aspect="AspectFill"
    Source="{Binding post.uploader.userProfile.userThumbnail}">

    <Image.GestureRecognizers>
        <TapGestureRecognizer Tapped="OnUserInfoClicked" />
    </Image.GestureRecognizers>
</ic:CircleImage>

Hope this helps!

pinedax
  • 8,608
  • 2
  • 19
  • 27