<xForms:SfListView ItemsSource="{Binding Items}" SelectionMode="None" AllowSwiping="True">
<xForms:SfListView.ItemTemplate>
<DataTemplate>
<Grid BackgroundColor="White">
<Label Text="{Binding .}"/>
</Grid>
</DataTemplate>
</xForms:SfListView.ItemTemplate>
</xForms:SfListView> |
<xForms:SfListView ItemsSource="{Binding Items}" SelectionMode="Single" AllowSwiping="True">
<xForms:SfListView.SelectedItemTemplate>
<DataTemplate>
<Grid>
<Label Text="{Binding .}"/>
</Grid>
</DataTemplate>
</xForms:SfListView. SelectedItemTemplate>
</xForms:SfListView> |
<sync:SfListView.ItemTemplate>
<DataTemplate x:Name="ItemTemplate" >
<syncEffectsView:SfEffectsView BackgroundColor="LightGreen"
x:Name="itemEffect" ShouldIgnoreTouches="True"
TouchDownEffects="Ripple"
RippleColor="LightYellow" Padding="0" Margin="5,1,5,1">
<Grid Padding="5" RowSpacing="2" ColumnSpacing="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" BackgroundColor="White">
<Label x:Name="TitleLabel" LineBreakMode="NoWrap" VerticalOptions="Center" Text="{Binding Title}"
FontAttributes="Bold" TextColor="Black">
</Label>
</Grid>
<Grid Grid.Column="1" BackgroundColor="White">
<Label x:Name="DescriptionLabel" VerticalOptions="Center" Text="{BindingDescription}" TextColor="Teal"/>
</Grid>
<Frame Grid.Column="2" Padding="4,2,4,2" BackgroundColor="White">
<Label x:Name="TagLabel" VerticalOptions="Center" LineBreakMode="NoWrap" Text="{Binding Tag}"
FontSize="10" TextColor="Black"/>
</Frame>
</Grid>
</syncEffectsView:SfEffectsView>
</DataTemplate>
</sync:SfListView.ItemTemplate> |
Case1:
<ContentPage xmlns:local="clr-namespace:SortingFiltering" Visual="Material"
xmlns:syncEffectsView="clr-namespace:Syncfusion.XForms.EffectsView;assembly=Syncfusion.Core.XForms"
xmlns:sync="clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms">
Case2:
Xaml:
<sync:SfListView.ItemTemplate>
<DataTemplate x:Name="ItemTemplate">
<syncEffectsView:SfEffectsView BackgroundColor="LightGreen"
x:Name="itemEffect" SelectionChanged="ItemEffect_SelectionChanged">
</syncEffectsView:SfEffectsView>
</DataTemplate>
</sync:SfListView.ItemTemplate>
CodeBehind:
public partial class MainPage : ContentPage
{
private void ItemEffect_SelectionChanged(object sender, EventArgs e)
{
// You can handle selection changed events instead TapCommand
}
} |