Xamarin.forms: [Bug] CollectionView with TapGestureRecognizer -> XLS0501 The property 'ElementTemplateContent' is set more than once.

Created on 25 Apr 2020  ·  3Comments  ·  Source: xamarin/Xamarin.Forms

Description

Error when try to add TapGestureRecognizer on CollectionView.

Steps to Reproduce

  1. Add CollectionView with itemsource from a ViewModel
  2. Put <TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped" />

Expected Behavior

No error.

Actual Behavior

XLS0501 The property 'ElementTemplateContent' is set more than once.

Basic Information

  • Version with issue: Xamarin.Forms v4.5.0.617
  • IDE: Visual Studio 2019 v16.5.4
  • Platform Target Frameworks:

    • Android:
  • Nuget Packages:

    • Sharpnado.Presentation Forms
  • Affected Devices:

    • All

GitHub Project

https://github.com/andrewBezerra/Xamarin_TODO

collectionview gestures 🖖 Android needs-info ❓ unverified bug

All 3 comments

Solved. A mistake mine.
The correct form is :
<acry:MaterialFrame.GestureRecognizers>
<TapGestureRecognizer Command="{Binding DoneTodoTask, Mode=OneWay}" />
</acry:MaterialFrame.GestureRecognizers>

@andrewBezerra So we can close this one?

Yes.

Was this page helpful?
0 / 5 - 0 ratings