我有一个CarouselView与多个图像,我想要得到什么被点击或点击。我尝试添加一个x:Name,但我无法访问GestureRecognizer中的此属性。在CarouselView中获取图像点击
这是我的xaml。我有4页,每页有两张照片。我会得到x:点击图像的名称或者我可以知道图像被点击的地方。
<Image Grid.Row="0" Aspect="Fill" Source="{Binding Image1}" x:Name="{Binding ImageName1}" >
<Image.GestureRecognizers>
<TapGestureRecognizer
Tapped="ClickImage" />
</Image.GestureRecognizers>
</Image>
<Image Grid.Row="1" Aspect="Fill" Source="{Binding Image2}" x:Name="{Binding ImageName2}">
<Image.GestureRecognizers>
<TapGestureRecognizer
Tapped="ClickImage" />
</Image.GestureRecognizers>
</Image>
谢谢!!这正是我期待的! – ivanbm
没问题! :) 很高兴我能帮上忙 – Martman