[Xaml]
<listView:SfListView x:Name="listView"DragStartMode="None"
ItemsSource="{Binding ContactItems}"
ItemSpacing="0,0,5,0">
<listView:SfListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View>
<Grid >
<listView:DragIndicatorView ListView="{x:ReferencelistView}" IsVisible="{Binding DragStartMode, Source={x:ReferencelistView},Converter={StaticResource dragValueConverter}}}">
<Grid >
<Image Source="DragIndicator.png" />
</Grid>
</listView:DragIndicatorView>
</Grid>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</listView:SfListView.ItemTemplate>
</listView:SfListView>
Converter
public class DragValueConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var dragMode = (DragStartMode)value ;
if (dragMode == DragStartMode.OnHold || dragMode == DragStartMode.OnDragIndicator)
return true;
else
return false;
}
public object ConvertBack(object value, Type targetType, objectparameter, CultureInfo culture)
{
throw new NotImplementedException();
}
} |