1

I am getting compile error with Image's Tapped Binding using Prism MVVM.

No property, bindable property, or event found for 'Tapped', or mismatching type between value and property.

This is my code

<Image Source="bell.png"  HeightRequest="25" WidthRequest="25" x:Name="yellowBoxView"
     RelativeLayout.YConstraint="{ConstraintExpression
     Type=RelativeToParent,
     Property=Height,
     Factor=0.018,Constant=10}"
     RelativeLayout.XConstraint="{ConstraintExpression
     Type=RelativeToParent,
     Property=Width,
     Factor=0.85,Constant=15}">
    <Image.GestureRecognizers>
        <TapGestureRecognizer Tapped="{Binding GetStaffAnnCommand}"></TapGestureRecognizer>
    </Image.GestureRecognizers>
</Image>

How can I solve this issue?

R15
  • 13,982
  • 14
  • 97
  • 173

1 Answers1

6

Try and bind to the Command property instead:

<Image.GestureRecognizers>
    <TapGestureRecognizer Command="{Binding GetStaffAnnCommand}"></TapGestureRecognizer>
</Image.GestureRecognizers>

Hope it helps & happy coding!

TaiT's
  • 3,138
  • 3
  • 15
  • 26