<?xml version="1.0" encoding="UTF-8" ?>
<ContentView
    x:Class="CafeTerrace.Views.Controller.BuyBagFoodItem"
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:d="http://xamarin.com/schemas/2014/forms/design"
    xmlns:forms="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:model="clr-namespace:CafeTerrace.Models;assembly=CafeTerrace"
    mc:Ignorable="d">
    <ContentView.Content>

        <Grid>

            <Grid Margin="0,15">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="90" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Frame
                    Padding="0"
                    CornerRadius="15"
                    HeightRequest="90"
                    WidthRequest="90">
                    <forms:CachedImage Aspect="AspectFill" Source="{Binding Path=Food.GetSingleFoodPhoto.Image}" />
                </Frame>
                <Button
                    Margin="0,0,-12,0"
                    Padding="0"
                    BackgroundColor="{StaticResource PrimaryColor}"
                    Clicked="FoodRemoveButton_OnClicked"
                    CornerRadius="25"
                    FontFamily="{StaticResource MaterialFontFamily}"
                    HeightRequest="28"
                    HorizontalOptions="Start"
                    Text="{x:Static model:MaterialIconFont.Close}"
                    TextColor="Accent"
                    VerticalOptions="Center"
                    WidthRequest="28" />
                <Grid Grid.Column="1" VerticalOptions="Center">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Label
                        Margin="25,0"
                        FontFamily="{StaticResource Shabname}"
                        FontSize="11"
                        HorizontalOptions="Center"
                        HorizontalTextAlignment="Center"
                        Text="{Binding Path=NameWType}"
                        TextColor="Accent" />
                    <Grid
                        Grid.Row="1"
                        Grid.Column="0"
                        HorizontalOptions="Center">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Button
                            Margin="5,0"
                            Padding="0"
                            BackgroundColor="Transparent"
                            Clicked="PlusButton_OnClicked"
                            FontFamily="{StaticResource MaterialFontFamily}"
                            FontSize="14"
                            HeightRequest="26"
                            Text="{x:Static model:MaterialIconFont.Plus}"
                            TextColor="Accent"
                            VerticalOptions="Center"
                            WidthRequest="26" />
                        <Label
                            x:Name="countLabel"
                            Grid.Column="1"
                            FontFamily="{StaticResource ShabnameBold}"
                            FontSize="16"
                            HorizontalOptions="Center"
                            Text="{Binding Path=Food.CountFood}"
                            TextColor="Accent" />
                        <Button
                            Grid.Column="2"
                            Margin="5,0"
                            Padding="0"
                            BackgroundColor="Transparent"
                            Clicked="MinusButton_OnClicked"
                            FontFamily="{StaticResource MaterialFontFamily}"
                            FontSize="14"
                            HeightRequest="26"
                            Text="{x:Static model:MaterialIconFont.Minus}"
                            TextColor="Accent"
                            VerticalOptions="Center"
                            WidthRequest="26" />
                    </Grid>
                    <StackLayout
                        Grid.Row="0"
                        Grid.Column="1"
                        HorizontalOptions="Center"
                        Orientation="Horizontal">
                        <Label
                            FontFamily="{StaticResource ShabnameBold}"
                            FontSize="16"
                            Text="{Binding Path=Food.Price.FinalAmount, StringFormat=' {0:N0} ریال'}"
                            TextColor="{StaticResource Orange}"
                            VerticalOptions="Center" />
                    </StackLayout>

                    <StackLayout
                        Grid.Row="1"
                        Grid.Column="1"
                        HorizontalOptions="Center"
                        Orientation="Horizontal">
                        <Label
                            x:Name="totalAmountLabel"
                            FontFamily="{StaticResource ShabnameBold}"
                            FontSize="19"
                            Text="{Binding Path=Food.Price.FinalAmount, StringFormat='{}{0:C0}'}"
                            TextColor="{StaticResource Orange}"
                            VerticalOptions="Center" />
                        <Label
                            FontFamily="{StaticResource Shabname}"
                            FontSize="10"
                            Text="ریال"
                            TextColor="{StaticResource Orange}"
                            VerticalOptions="Center" />
                    </StackLayout>
                </Grid>
            </Grid>
        </Grid>
    </ContentView.Content>
</ContentView>