<?xml version="1.0" encoding="utf-8"?>

<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:grid="clr-namespace:Syncfusion.SfDataGrid.XForms;assembly=Syncfusion.SfDataGrid.XForms"
             xmlns:ui="clr-namespace:XF.Material.Forms.UI;assembly=XF.Material"
             xmlns:mobile="clr-namespace:InABox.Mobile;assembly=InABox.Mobile.Shared"
             xmlns:pull="clr-namespace:Syncfusion.SfPullToRefresh.XForms;assembly=Syncfusion.SfPullToRefresh.XForms"
             x:Class="InABox.Mobile.MobileGrid" 
             x:DataType="mobile:MobileGrid"
             >
    <ContentView.Content>
        <Grid RowSpacing="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            
            <mobile:MobileSearchBar 
                x:Name="Search"
                Grid.Row="0"
                IsVisible="true"
                PlaceHolder="Search"
                TextChanged="Search_OnTextChanged" 
                BackgroundColor="Transparent"
                Margin="0,0,0,5"
                />

            <mobile:MobileCard
                Grid.Row="1"
                BackgroundColor="WhiteSmoke">
                <!-- <pull:SfPullToRefresh -->
                <!--     Refreshing="SfPullToRefresh_OnRefreshing" -->
                <!--     x:Name="pullToRefresh" -->
                <!--     IsRefreshing="False"  -->
                <!--     PullingThreshold="100" -->
                <!--     RefreshContentHeight="0" -->
                <!--     RefreshContentThreshold="0" -->
                <!--     RefreshContentWidth="0" -->
                <!--     TransitionMode="Push"> -->
                <!--      -->
                <!--     <pull:SfPullToRefresh.PullableContent> -->
                        <grid:SfDataGrid 
                            x:Name="Grid" 
                            AutoGenerateColumns="False"
                            SelectionMode="Single"
                            GridViewCreated="Grid_OnGridViewCreated"
                            SelectionChanged="Grid_OnSelectionChanged"
                            GridTapped="Grid_OnGridTapped"
                            AllowPullToRefresh="True"
                            >
                            <grid:SfDataGrid.GridStyle>
                                <grid:DefaultStyle 
                                    GridCellBorderWidth="0"
                                    RowBackgroundColor="White"
                                    RowForegroundColor="Black"
                                    AlternatingRowColor="WhiteSmoke"
                                    SelectionBackgroundColor="Purple"
                                    SelectionForegroundColor="White"
                                    HeaderForegroundColor="DimGray"
                                    HeaderBackgroundColor="Transparent"
                                    HeaderCellBorderWidth="0"/>
                            </grid:SfDataGrid.GridStyle>
                        </grid:SfDataGrid>
                <!--     </pull:SfPullToRefresh.PullableContent> -->
                <!-- </pull:SfPullToRefresh> -->
                
            </mobile:MobileCard>
            
            <mobile:MobileCard
                Grid.Row="2"
                Margin="0,5,0,0"
                x:Name="_refreshgrid"
                Padding="5">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    
                    <Label 
                        x:Name="_lastupdate"
                        Grid.Column="0" 
                        HorizontalTextAlignment="Start"
                        FontSize="Micro"
                        TextColor="Black"/>
                    
                    <Label
                        x:Name="_numrecords"
                        Grid.Column="1"
                        HorizontalTextAlignment="Center"
                        FontSize="Micro"
                        TextColor="Black"/>
                    
                    <Label 
                        x:Name="_pulltorefresh"
                        Grid.Column="2" 
                        HorizontalTextAlignment="End"
                        FontSize="Micro"
                        Text="Pull To Refresh"
                        TextColor="Black"/>
                
                </Grid>
            </mobile:MobileCard>
            
        </Grid>
    </ContentView.Content>
</ContentView>