EffectsView for Ripple Effect on SfListView that uses HoldCommand

Hi,

I have the following scenario: 

<syncf:SfListView x:Name="List"
                          VerticalOptions="Center"
                          SelectionMode="Single"
                          ItemsSource="{Binding DisplayItems}"
                          SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
                          SelectionBackgroundColor="{Static styles:Colors.None}"
                          BackgroundColor="{Static styles:Colors.None}"
                          FocusBorderColor="{Static styles:Colors.None}"
                          ItemSpacing="{Static styles:Parameters.DeviceListItemSpacing}"
                          HoldCommand="{Binding OpenDevicePopupCommand}">
                <syncf:SfListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell>
                            <sfEffects:SfEffectsView TouchDownEffects="Ripple">
                                <views:DeviceListItem/>
                            </sfEffects:SfEffectsView>
                        </ViewCell>
                    </DataTemplate>
                </syncf:SfListView.ItemTemplate>
</syncf:SfListView>

I didn't manage to make EffectsView.LongPressedCommand work on UWP, so I opted out for using the HoldCommand within the SfListView. The problem is that the HoldCommand is not fired up if the ItemTemplate is wrapped up by SfEffectsView. Instead, only the ripple occurs.

1 Reply 1 reply marked as answer

SS Sridevi Sivakumar Syncfusion Team March 12, 2021 05:25 PM UTC

Hi Miguel,

Greetings from Syncfusion.


We have analysed your requirement with a provided code snippet. We would like to inform you that while adding SfEffectsView inside our SfListView, touch action only gets inside SfEffectsView. The interaction will not get in SfListView.

You can do the HoldCommand action code in our SfEffectView AnimationCompleted event. It will occur on completion of effects.

For more information

https://www.syncfusion.com/kb/11661/how-to-get-the-selected-item-from-listview-while-using-effectsview-within-itemtemplate


https://www.syncfusion.com/kb/11030/how-to-use-effects-view-in-listview-sflistview-xamarin-forms

Let us know if you need any further assistance.

Regards, 
Sridevi S.  


Marked as answer
Loader.
Up arrow icon