<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="inutralia.Views.Question.PendingReadView"
             Title="Pendientes de leer"
             Icon="pendiente"
             BackgroundColor="{DynamicResource BasePageColor}">

    <ContentPage.Content>
        <StackLayout Orientation="Vertical" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
            <Frame Margin="0,0,0,8" Padding="14,14,14,14" BackgroundColor="{DynamicResource AccentColor}">
                <StackLayout Orientation="Horizontal" VerticalOptions="FillAndExpand" HorizontalOptions="CenterAndExpand">
                    <Label Text="Consultas pendientes de contestar" HorizontalOptions="FillAndExpand" VerticalOptions="Center" TextColor="White">
                        <Label.FontSize>
                            <OnIdiom x:TypeArguments="x:Double">
                                <OnIdiom.Phone>
                                    <OnPlatform x:TypeArguments="x:Double" 
                                            iOS="20"
                                            Android="18"/>
                                </OnIdiom.Phone>

                                <OnIdiom.Tablet>
                                    <OnPlatform x:TypeArguments="x:Double" 
                                            iOS="40"
                                            Android="30"/>
                                </OnIdiom.Tablet>
                            </OnIdiom>
                        </Label.FontSize>
                    </Label>
                </StackLayout>
            </Frame>

            <StackLayout VerticalOptions="FillAndExpand" Margin="15,15" Padding="0,15,0,15">

                <ListView x:Name="ListView"
                  ItemsSource="{Binding }"
                  ItemTapped="ItemTapped"
                  IsPullToRefreshEnabled="True"
                  IsRefreshing="{Binding Busy, Mode=TwoWay}"
                  BackgroundColor="Transparent"
                  Footer=""
                  CachingStrategy="RecycleElement"
                  HasUnevenRows="False"
                  Margin="10,10">

                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <ViewCell>
                                <Grid Margin="0,10,0,10" VerticalOptions="CenterAndExpand">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>

                                    <StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
                                        <Label Text="{Binding Text}" FontSize="Medium" HorizontalOptions="StartAndExpand" TextColor="Black"/>
                                        <Label x:Name="State" Text="{Binding State}" HorizontalOptions="EndAndExpand" TextColor="Black"/>
                                        <Image Source="{Binding StatusImg}" Aspect="AspectFit" HorizontalOptions="EndAndExpand"/>
                                    </StackLayout>
                                </Grid>
                            </ViewCell>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
            </StackLayout>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>