<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
    x:Class="CafeTerrace.Views.BuyBagPage"
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:forms="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
    xmlns:model="clr-namespace:CafeTerrace.Models"
    xmlns:prism="http://prismlibrary.com"
    prism:ViewModelLocator.AutowireViewModel="True"
    BackgroundColor="{StaticResource Gray-200}"
    FlowDirection="RightToLeft"
    NavigationPage.HasNavigationBar="False">
    <Grid Margin="0,40,0,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <ScrollView Grid.Row="1">
            <FlexLayout
                AlignContent="Center"
                JustifyContent="Center"
                VerticalOptions="Center"
                Wrap="Wrap">
                <BindableLayout.ItemsSource>
                    <x:Array Type="{x:Type x:String}">
                        <x:String>amir</x:String>
                        <x:String>amir</x:String>
                        <x:String>amir</x:String>
                        <x:String>amir</x:String>
                        <x:String>amir</x:String>
                        <x:String>amir</x:String>
                        <x:String>amir</x:String>
                        <x:String>amir</x:String>
                        <x:String>amir</x:String>
                        <x:String>amir</x:String>
                        <x:String>amir</x:String>
                    </x:Array>
                </BindableLayout.ItemsSource>
                <BindableLayout.ItemTemplate>
                    <DataTemplate>
                        <Frame
                            Margin="8"
                            Padding="0"
                            CornerRadius="7"
                            HeightRequest="230"
                            WidthRequest="170">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <forms:CachedImage Aspect="AspectFit" Source="https://assets.blog.foodnetwork.ca/imageserve/wp-content/uploads/2019/11/18140824/2020-food-trends-west-african-cuisine/x.jpg" />
                                <Label
                                    Grid.Row="1"
                                    HorizontalOptions="Center"
                                    Text="سبد قارچ و مرغ"
                                    TextColor="#444" />
                                <Grid Grid.Row="2">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <Button
                                        Margin="20,0"
                                        Padding="0"
                                        BackgroundColor="White"
                                        BorderColor="{StaticResource PrimaryColor}"
                                        BorderWidth="3"
                                        CornerRadius="8"
                                        FontFamily="{StaticResource MaterialFontFamily}"
                                        HeightRequest="30"
                                        Text="{x:Static model:MaterialIconFont.Plus}"
                                        TextColor="{StaticResource PrimaryColor}"
                                        VerticalOptions="Center"
                                        WidthRequest="30" />
                                    <Label
                                        Grid.Column="1"
                                        FontFamily="{StaticResource ShabnameBold}"
                                        FontSize="27"
                                        HorizontalOptions="Center"
                                        Text="5"
                                        TextColor="{StaticResource PrimaryColor}" />
                                    <Button
                                        Grid.Column="2"
                                        Margin="20,0"
                                        Padding="0"
                                        BackgroundColor="White"
                                        BorderColor="{StaticResource PrimaryColor}"
                                        BorderWidth="3"
                                        CornerRadius="8"
                                        FontFamily="{StaticResource MaterialFontFamily}"
                                        HeightRequest="30"
                                        Text="{x:Static model:MaterialIconFont.Minus}"
                                        TextColor="{StaticResource PrimaryColor}"
                                        VerticalOptions="Center"
                                        WidthRequest="30" />
                                </Grid>
                                <StackLayout
                                    Grid.Row="3"
                                    HorizontalOptions="Center"
                                    Orientation="Horizontal">
                                    <Label
                                        FontFamily="{StaticResource ShabnameBold}"
                                        FontSize="20"
                                        Text="200000"
                                        TextColor="{StaticResource Orange}"
                                        VerticalOptions="Center" />
                                    <Label
                                        FontFamily="{StaticResource Shabname}"
                                        FontSize="16"
                                        Text="تومان"
                                        TextColor="{StaticResource Orange}"
                                        VerticalOptions="Center" />
                                </StackLayout>
                            </Grid>
                        </Frame>
                    </DataTemplate>
                </BindableLayout.ItemTemplate>
            </FlexLayout>
        </ScrollView>
        <StackLayout Grid.Row="2" Margin="15,15">
            <Frame
                Padding="5"
                CornerRadius="8"
                HeightRequest="38">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Entry FontSize="14" Placeholder="کـــد تخفیف" />
                    <Button
                        Grid.Column="1"
                        Padding="0"
                        BackgroundColor="{StaticResource PrimaryColor}"
                        CornerRadius="5"
                        FontFamily="{StaticResource MaterialFontFamily}"
                        FontSize="24"
                        HeightRequest="35"
                        Text="{x:Static model:MaterialIconFont.Check}"
                        TextColor="White"
                        VerticalOptions="Center"
                        WidthRequest="35" />
                </Grid>
            </Frame>
            <Frame
                Padding="5"
                CornerRadius="8"
                HeightRequest="38">
                <Grid Margin="15,0" VerticalOptions="Center">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Label
                        FontSize="16"
                        Text="مجموع پرداخت"
                        VerticalOptions="Center" />

                    <StackLayout Grid.Column="1" Orientation="Horizontal">
                        <Label
                            FontFamily="{StaticResource ShabnameBold}"
                            FontSize="22"
                            Text="20000"
                            TextColor="{StaticResource Orange}" />
                        <Label
                            FontFamily="{StaticResource Shabname}"
                            FontSize="15"
                            Text="تومان"
                            TextColor="{StaticResource Orange}"
                            VerticalOptions="Center" />
                    </StackLayout>
                </Grid>
            </Frame>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Button
                    Margin="5"
                    BackgroundColor="{StaticResource Green}"
                    CornerRadius="8"
                    Text="تایید و سفارش"
                    TextColor="White" />
                <Button
                    Grid.Column="1"
                    Margin="5"
                    BackgroundColor="{StaticResource Red}"
                    CornerRadius="8"
                    Text="پاک کردن همه"
                    TextColor="White" />
            </Grid>
        </StackLayout>
    </Grid>
</ContentPage>