<?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.NutriQuestion.NutriQuestionListView"
             Title="Consultas">

    <StackLayout Padding="15,15,15,30">
        <!-- botón superio añadir consulta-->
        <Button Text="+ CONSULTA"
                VerticalOptions="CenterAndExpand"
                HorizontalOptions="End"
                BackgroundColor="#333333"
                TextColor="#ffffff"
                Clicked="NewQuestion_Clicked"
                />
        <!--Titulo listado de consultas-->
        <StackLayout BackgroundColor="#333333">
            <Label 
               Margin="15,15,0,15"
               TextColor="#ffffff"
               FontAttributes="Bold"
               Text="HISTÓRICO DE MIS CONSULTAS"/>
        </StackLayout>
    
        <!-- listView-->
        <ListView x:Name="listConversations"
            ItemsSource="{Binding Conversations}"
            ItemTapped="Handle_ItemTapped"
            CachingStrategy="RecycleElement"          
            HasUnevenRows ="True">
            
             <ListView.ItemTemplate>
                <DataTemplate>
                <ViewCell>

                    <!-- Two-column grid -->
                    <Grid Padding="10,10,10,10">

                        <Grid.RowDefinitions>
                            <RowDefinition  />
                            <RowDefinition />
                           
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="70*" />
                            <ColumnDefinition Width="30*" />
                        </Grid.ColumnDefinitions>

                        <!-- row 0 Left column  -->
                        <Label Grid.Row="0" Grid.ColumnSpan="2"
                               TextColor="#000000"
                               FontAttributes="Bold"
                               Text="{Binding Subject}"/>

                        <!-- row 0 Right column -->
                        <!--<Label  Grid.Row="0" Grid.Column="1"
                               TextColor="#000000"
                               Text="{Binding Leida}"/>-->

                        <!-- row 1 Left column -->
                        <Label  Grid.Row="1" Grid.Column="0"
                               FontSize="Micro"
                               TextColor="#000000"
                               Text="{Binding Created_at}"/>

                 
                  
                        <!-- row 1 Right column -->
                            <Label  Grid.Row="1" Grid.Column="1"
                                XAlign="End"
                                FontSize="Micro"
                                TextColor="#000000"
                                Text="{Binding State}"/>
                        </Grid>
                </ViewCell>
            </DataTemplate>
             </ListView.ItemTemplate>
  
        </ListView>

    </StackLayout>
</ContentPage>
