<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:maps="clr-namespace:Xamarin.Forms.Maps;assembly=Xamarin.Forms.Maps"
    xmlns:converters="clr-namespace:TripLog.Converters;assembly=TripLog"
    x:Class="TripLog.Views.DetailPage">
    <ContentPage.Resources>
        <ResourceDictionary>
            <converters:RatingToStarImageNameConverter x:Key="RatingToStartImageNameConverter" />
        </ResourceDictionary>
    </ContentPage.Resources>
    <ContentPage.Content>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="4*" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="1*" />
            </Grid.RowDefinitions>
            <maps:Map x:Name="map" Grid.RowSpan="3" />
            <BoxView Grid.Row="1" BackgroundColor="White" Opacity=".8" />
            <StackLayout Padding="10" Grid.Row="1">
                <Label x:Name="title" Text="{Binding Entry.Title}" HorizontalOptions="Center"
                       AutomationProperties.IsInAccessibleTree="true"
                       AutomationProperties.HelpText="Title of trip" />
                <Label x:Name="date" Text="{Binding Entry.Date, StringFormat='{0:M}'}" HorizontalOptions="Center"
                       AutomationProperties.IsInAccessibleTree="true"
                       AutomationProperties.HelpText="Date of trip" />
                <Image HorizontalOptions="Center" Source="{Binding Entry.Rating, Converter={StaticResource RatingToStartImageNameConverter}}"
                       AutomationProperties.IsInAccessibleTree="true"
                       AutomationProperties.HelpText="{Binding Entry.Rating, StringFormat='{0} star rating'}"/>
                <Label x:Name="notes" Text="{Binding Entry.Notes}" HorizontalOptions="Center"
                       AutomationProperties.IsInAccessibleTree="true"
                       AutomationProperties.HelpText="Notes from trip" />
            </StackLayout>
        </Grid>
    </ContentPage.Content>
</ContentPage>
