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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Footer Event/Command

Thread ID:

Created:

Updated:

Platform:

Replies:

130682 May 25,2017 01:52 PM UTC May 31,2017 06:18 AM UTC Xamarin.Forms 7
loading
Tags: SfListView
Emanuele Filardo
Asked On May 25, 2017 01:52 PM UTC

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

Dinesh Babu Yadav [Syncfusion]
Replied On 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 
 


Emanuele Filardo
Replied On May 26, 2017 02:51 PM UTC

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

Dinesh Babu Yadav [Syncfusion]
Replied On May 29, 2017 04:07 AM UTC

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


Emanuele Filardo
Replied On 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

Muthu Kumaran Gnanavinayagam [Syncfusion]
Replied On 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. 


Emanuele Filardo
Replied On 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

Dinesh Babu Yadav [Syncfusion]
Replied On May 31, 2017 06:18 AM UTC

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;