<?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="TripLog.Views.MainPage"
    Title="TripLog">
    <ContentPage.ToolbarItems>
        <ToolbarItem Text="New" Clicked="New_Clicked" />
    </ContentPage.ToolbarItems>
    <ContentPage.Content>
        <CollectionView x:Name="trips"
                        SelectionMode="Single"
                        SelectionChanged="Trips_SelectionChanged">
            <CollectionView.ItemTemplate>
                <DataTemplate>
                    <Grid Padding="10">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1*" />
                            <ColumnDefinition Width="3*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Label Grid.RowSpan="2"
                               Text="{Binding Date, StringFormat='{0:MMM d}'}" />
                        <Label Grid.Column="1"
                               Text="{Binding Title}"
                               FontAttributes="Bold" />
                        <Label Grid.Column="1"
                               Grid.Row="1"
                               Text="{Binding Notes}" />
                    </Grid>
                </DataTemplate>
            </CollectionView.ItemTemplate>
        </CollectionView>
    </ContentPage.Content>
</ContentPage>