<?xml version="1.0" encoding="UTF-8" ?>
<ContentView
    x:Class="CafeTerrace.Views.DialogBox.JobDialogBox"
    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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Margin="80,40"
    mc:Ignorable="d">
    <ContentView.Content>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <ScrollView HorizontalScrollBarVisibility="Always">
                <StackLayout BindableLayout.ItemsSource="{Binding .}">
                    <BindableLayout.ItemTemplate>
                        <DataTemplate>
                            <StackLayout>
                                <Frame
                                    Padding="0,15"
                                    BackgroundColor="Accent"
                                    CornerRadius="10">
                                    <Label
                                        FontSize="16"
                                        HorizontalOptions="Center"
                                        Text="{Binding Name}"
                                        TextColor="{StaticResource PrimaryColor}"
                                        VerticalOptions="Center" />
                                </Frame>

                                <StackLayout BindableLayout.ItemsSource="{Binding ChildJobs}">
                                    <BindableLayout.ItemTemplate>
                                        <DataTemplate>
                                            <Frame
                                                Padding="0,10"
                                                BackgroundColor="White"
                                                CornerRadius="10">
                                                <Label
                                                    FontSize="14"
                                                    HorizontalOptions="Center"
                                                    Text="{Binding Name}"
                                                    TextColor="Accent"
                                                    VerticalOptions="Center" />
                                                <Frame.GestureRecognizers>
                                                    <TapGestureRecognizer Tapped="JobItem_OnTapped" />
                                                </Frame.GestureRecognizers>
                                            </Frame>
                                        </DataTemplate>
                                    </BindableLayout.ItemTemplate>
                                </StackLayout>
                            </StackLayout>
                        </DataTemplate>
                    </BindableLayout.ItemTemplate>
                </StackLayout>
            </ScrollView>
            <Button
                Grid.Row="1"
                Margin="0,0,0,0"
                Padding="0"
                BackgroundColor="{StaticResource PrimaryColor}"
                Clicked="SubmitButton_OnClicked"
                Command="{Binding OpenJobDialogCommand}"
                CornerRadius="30"
                FontSize="14"
                HeightRequest="40"
                Text="تایید و ثبت"
                TextColor="Accent"
                VerticalOptions="End" />
        </Grid>
    </ContentView.Content>
</ContentView>