<?xml version="1.0" encoding="UTF-8"?>
<ContentView 
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:local="clr-namespace:inutralia;assembly=inutralia"
	xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
    x:Class="inutralia.Views.RecipeItemTemplate"
    x:Name="RecipeItemTemplate" 
    BackgroundColor="White">

    <!--<ContentPage.Resources>
        <ResourceDictionary>
            <local:ImageTransformator x:Key="cnvImg"></local:ImageTransformator>
        </ResourceDictionary>
    </ContentPage.Resources>-->

    <Grid BackgroundColor="Black">

        <!-- TODO: Cambiar icon.png por imagen adecuada -->
        <ffimageloading:CachedImage
            FadeAnimationEnabled="true" 
			Source="{ Binding Image }"
			Aspect="AspectFill"
			Opacity="0.5"/>

        <Grid
            ColumnSpacing="0" 
			RowSpacing="6" 
			Padding="20">

            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="10" />
            </Grid.RowDefinitions>
          
            <!--PARTE SUPERIOR-->
            <StackLayout 
                Grid.Row="0" 
				        VerticalOptions="End" 
				        HorizontalOptions="Start">
                
                <StackLayout 
                    Grid.Row="1"
				            Orientation="Horizontal" 
				             HorizontalOptions="Fill"
				             VerticalOptions="FillAndExpand"
                     Padding="5"
                   >
                    <!--TITULO-->
                    <Label
                        FontSize="30"
					              FontAttributes="Bold"
					              Text="{Binding ShortName}" 
					              LineBreakMode="WordWrap"
					              TextColor="{ DynamicResource InverseTextColor }"/>
                </StackLayout>
            </StackLayout>
            
            <!--PARTE INFERIOR-->
            <StackLayout 
                Grid.Row="1"
				        Orientation="Horizontal" 
				        HorizontalOptions="FillAndExpand"
				        VerticalOptions="End">
                
                <!--RESUMEN -->
                             
                    <Label 
                        Text="{ Binding Excerpt}"
                        TextColor="{ DynamicResource InverseTextColor }"
                      
                        HorizontalOptions="FillAndExpand" 	    />
     
                <!--KCAL-->
               
                   <!-- <Label 
                          Text="{Binding Energy}" 
					               TextColor="{ DynamicResource InverseTextColor }" 
                         FontSize="Small"
					                LineBreakMode="NoWrap"
                         HorizontalOptions="End"	   />-->
				
                </StackLayout>
          

            <BoxView 
                Grid.Row="2"
				    Style="{StaticResource BrandNameOrnamentStyle}"/>
        </Grid>
    </Grid>

</ContentView>
