<ContentPage
    x:Class="ListViewMaui.MainPage"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:dataSource="clr-namespace:Syncfusion.Maui.DataSource;assembly=Syncfusion.Maui.DataSource"
    xmlns:local="clr-namespace:ListViewMaui"
    xmlns:syncfusion="clr-namespace:Syncfusion.Maui.ListView;assembly=Syncfusion.Maui.ListView">

    <ContentPage.BindingContext>
        <local:ListViewSortingViewModel />
    </ContentPage.BindingContext>
    <!--<ContentPage.Resources>
        <ResourceDictionary>
            <local:CustomGroupComparer x:Key="CustomGroupComparer" />
            <local:ShortDateGroupComparer x:Key="ShortDateGroupComparer" />
        </ResourceDictionary>
    </ContentPage.Resources>-->

    <syncfusion:SfListView
        x:Name="listView"
        Margin="0,10,0,0"
      AutoFitMode="Height"
        ItemsSource="{Binding ContactsInfo}">
       

        <syncfusion:SfListView.ItemTemplate>
            <DataTemplate>
                <Grid HeightRequest="{Binding Height}">
                    <Grid x:Name="grid" RowSpacing="0">
                        <Grid
                            Padding="10,0,0,0"
                            RowSpacing="2"
                            VerticalOptions="Center">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>

                            <Label
                                Padding="0,10,0,0"
                                FontSize="15"
                                LineBreakMode="NoWrap"
                                Text="{Binding ContactName}"
                                TextColor="#474747" />
                            <Label
                                Grid.Row="1"
                                Grid.Column="0"
                                Padding="0,0,0,3"
                                FontSize="15"
                                LineBreakMode="NoWrap"
                                Text="{Binding ContactNumber}"
                                TextColor="#474747" />
                        </Grid>
                        <Grid
                            Grid.Row="0"
                            Grid.Column="2"
                            Padding="0,10,10,0"
                            HorizontalOptions="End"
                            RowSpacing="0"
                            VerticalOptions="Start">
                            <Label
                                Grid.Column="2"
                                FontSize="15"
                                LineBreakMode="NoWrap"
                                Text="{Binding ContactType}"
                                TextColor="#474747" />
                        </Grid>
                    </Grid>
                    <StackLayout
                        Grid.Row="1"
                        BackgroundColor="#E4E4E4"
                        HeightRequest="1" />
                </Grid>
            </DataTemplate>
        </syncfusion:SfListView.ItemTemplate>
    </syncfusion:SfListView>

</ContentPage>
