We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Footer Event/Command

Hi, I can't get Event or Command invocation form Image with TapGesture in footer, these is a sample?

7 Replies

DB Dinesh Babu Yadav Syncfusion Team May 26, 2017 11:06 AM UTC

Hi Emanuele, 
 
Thank you for using Syncfusion Products. 
 
We regret to inform you that SfListView do not have support for any command or event for Footer but you can load any view by adding gesturerecognizer in DataTemplate to FooterTemplate. So, you can load image with gesture in ItemTemplate like below code example. Here, we are adding the TapGestureRecognizer to notify the user whenever tapping on the image as per your requirement. 
 
Code Example[XAML]: 
<listView:SfListView x:Name="listView" ItemSize="70" AutoFitMode="Height" 
                     IsStickyFooter="True" IsStickyHeader="True" 
                     ItemsSource="{Binding ContactsInfo}"  
                     ItemSpacing="0,0,5,0"> 
 
  <listView:SfListView.FooterTemplate> 
    <DataTemplate> 
      <Grid BackgroundColor="Teal"> 
        <Image Source="Tap.jpg" 
               VerticalOptions="Center" HorizontalOptions="Center" Aspect="AspectFit" 
               HeightRequest="50" WidthRequest="50"> 
          <Image.GestureRecognizers> 
            <TapGestureRecognizer NumberOfTapsRequired="1" 
                                  Command="{Binding Path=BindingContext.TapCommand,  
                                  Source = {x:Reference listView}}" 
                                  CommandParameter="{Binding .}" /> 
          </Image.GestureRecognizers> 
        </Image> 
      </Grid> 
    </DataTemplate> 
  </listView:SfListView.FooterTemplate 
</listView:SfListView> 
 
Code Example[C#]: 
private void OnTapped(object obj) 
{ 
  Application.Current.MainPage.DisplayAlert("FooterItem", "Tapped Item is Footer", "OK"); 
} 
 
For your reference, we have attached the sample based on your requirement and you can download it from the below location. 
 
 
For more information about header and footer in SfListView, please refer the following UG documentation link. 
 
 
Please let us know if you require further assistance. 
 
Regards, 
Dinesh Babu Yadav 
 



EF Emanuele Filardo May 26, 2017 02:51 PM UTC

Found problem, in ViewModel I'm using ICommand instead of Command<object>.
Thanks!


DB Dinesh Babu Yadav Syncfusion Team May 29, 2017 04:07 AM UTC

Hi Emanuele, 
 
Thanks for the update. 
 
Regards, 
Dinesh Babu Yadav 



EF Emanuele Filardo May 29, 2017 08:17 AM UTC

Since in Xamarin documentation there is use ICommand, but this doesn't work as expected with Syncfusion SfListView, i would suggest to specify this in your documentation.

Syncfusion 15.2.0.40
Xamarin.Forms 2.3.4.247


MK Muthu Kumaran Gnanavinayagam Syncfusion Team May 30, 2017 10:26 AM UTC

Hi Emanuele, 
 
Thanks for the update. We have checked the reported query in both cases (i.e using ICommand and Command<object>) with our sample and it is working fine as expected. For your reference we have attached the working sample link below. We have already planned to update the documentation regarding the reported query and it will be included in further release. 
 
 
Regards, 
G.Muthu Kumaran. 



EF Emanuele Filardo May 30, 2017 01:06 PM UTC

Hi, I've tried again and now ICommand works well, probably there was a mistake in xaml, even if I don't seem to have changed.
Thanks again


DB Dinesh Babu Yadav Syncfusion Team May 31, 2017 06:18 AM UTC

Hi Emanuele, 
 
Thanks for the update. 
 
Regards, 
Dinesh Babu Yadav 


Loader.
Live Chat Icon For mobile
Up arrow icon