<?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.HistoryView"
             x:Name="historyView"
             Title="Histórico"
             Icon="History1"
             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="Listado de histórico de consultas" 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 QuestionList}"
                  ItemTapped="ItemTapped"
                          
                  IsPullToRefreshEnabled="True"
                  RefreshCommand="{Binding RefreshQuestionListCommand}"
                  IsRefreshing="{Binding Busy, Mode=TwoWay}"
                          
                  BackgroundColor="Transparent"
                  Footer=""
                  CachingStrategy="RecycleElement"
                  HasUnevenRows="True"
                  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 Text="{Binding Subject}" FontSize="Medium" HorizontalOptions="CenterAndExpand" TextColor="Black"/>
                                    </StackLayout>
                                </Grid>
                            </ViewCell>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
            </StackLayout>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>