如何在Xamarin.Forms列表视图中长按动作时停止Item tapped事件

时间:2018-02-28 10:10:48

标签: c# xaml xamarin xamarin.forms

当我们长按ListView时,它会触发ItemTappedLongPress事件如何在使用ItemTapped时停止LongPress事件?我正在为LongPress事件使用mr.gestures。

<StackLayout Padding="8,0,8,0" >
    <mr:ListView  x:Name="AllListStack" IsPullToRefreshEnabled="True" RowHeight="55" LongPressed="Cell_LongPressed"
        Swiped="Cell_Swiped" ItemTapped="ListView_ItemTapped">
        <ListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>
                    <ViewCell.View>
                        <StackLayout Orientation="Horizontal">
                            <controls:ExtendedLabel IsStrikeThrough="{Binding Isstrickout}" x:Name="Tasktitle" FontSize="20" Text="{Binding TaskTitle}" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" />
                            <!--<Button x:Name="Tasktitle" Text="{Binding TaskTitle}" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand"></Button>-->
                            <Label x:Name="TaskTime" IsVisible="{Binding Isvisable}" FontSize="13" Text="{Binding TaskTime}" HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand" />
                            <Image x:Name="imgalram" IsVisible="{Binding Isvisable}" Source="Alarm.png" HorizontalOptions="FillAndExpand" HeightRequest="28" />
                        </StackLayout>
                    </ViewCell.View>
                </ViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>
    </mr:ListView>
</StackLayout>

0 个答案:

没有答案