<?xml version="1.0" encoding="UTF-8"?>

<ContentPage
    BackgroundColor="{DynamicResource BlackColor}"
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:resources="clr-namespace:TheGameExtreme.Resx"
    x:Class="TheGameExtreme.view.GamePreparationPage">

    <Grid
        Margin="10,10,10,10">
        <Grid.RowDefinitions>
            <RowDefinition Height="20*" />
            <RowDefinition Height="80*" />
                
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="35*" />
            <ColumnDefinition Width="10*" />
            <ColumnDefinition Width="10*" />
            <ColumnDefinition Width="45*" />
        </Grid.ColumnDefinitions>

        <StackLayout
            Grid.Row="0"
            Grid.Column="0"
            Grid.ColumnSpan="2"
            Orientation="Horizontal">
            <ImageButton
                Source="ArrowSettingsBack.png"
                VerticalOptions="Start" 
                HorizontalOptions="StartAndExpand" 
                HeightRequest="40" 
                WidthRequest="50"                    
                Clicked="Back"
                BackgroundColor="Transparent"/>
        </StackLayout>

        <StackLayout
            Grid.Row="0"
            Grid.Column="1"
            Grid.ColumnSpan="2">
            <Button
                Text="{x:Static resources:AppResources.StrBtnPlay}"
                Clicked="Play"
                VerticalOptions="Start" 
                HorizontalOptions="Center"
                MinimumWidthRequest="30"
                WidthRequest="100"
                BackgroundColor="{DynamicResource Gold}"
                CornerRadius="10"/>
        </StackLayout>

        <Grid
            Grid.Row="1"
            Grid.Column="2"
            Grid.ColumnSpan="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="25*" />
                <RowDefinition Height="25*" />
                <RowDefinition Height="25*" />
                <RowDefinition Height="25*" />
            </Grid.RowDefinitions>

            <StackLayout
                Grid.Row="0"
                Orientation="Horizontal">
                <Label
                    Text="{x:Static resources:AppResources.StrNbPlayers}"
                    TextColor="{DynamicResource WhiteColor}"
                    FontSize="16"
                    VerticalTextAlignment="Center"
                    HorizontalTextAlignment="Center"/>
                
                
                <Slider
                    x:Name="PlayerSelecter"
                    Maximum="5"
                    Minimum="1"
                    ThumbColor="{DynamicResource SkyBlueColor}"
                    ValueChanged="ChangedPseudo"
                    HorizontalOptions="Center"
                    VerticalOptions="Center"
                    WidthRequest="150"
                    Value="1"/>

                <Label
                    TextColor="{DynamicResource WhiteColor}"
                    FontSize="16"
                    x:Name="nbPlayersChoose"
                    VerticalTextAlignment="Center"
                    HorizontalTextAlignment="Center"/>

            </StackLayout>

            <StackLayout
                Grid.Row="3"
                Orientation="Horizontal">

                <Label
                    Text="{x:Static resources:AppResources.StrValueType}"
                    TextColor="{DynamicResource WhiteColor}"
                    FontSize="16"
                    VerticalTextAlignment="Center"
                    HorizontalTextAlignment="Center"/>

                <Picker
                    x:Name="SelectMode"
                    BackgroundColor="{DynamicResource SkyBlueColor}"
                    HorizontalOptions="Center"
                    VerticalOptions="Center"
                    MinimumWidthRequest="30"
                    WidthRequest="150"/>

            </StackLayout>

            <StackLayout
                Grid.Row="1"
                Orientation="Horizontal">

                <Label
                    Text="{x:Static resources:AppResources.StrNbStacksInGame}"
                    TextColor="{DynamicResource WhiteColor}"
                    FontSize="16"
                    VerticalTextAlignment="Center"
                    HorizontalTextAlignment="Center"/>
                
                <Slider
                    x:Name="SelectNbStack"
                    Maximum="8"
                    Minimum="4"
                    ThumbColor="{DynamicResource SkyBlueColor}"
                    ValueChanged="ChangedStacks"
                    HorizontalOptions="Center"
                    VerticalOptions="Center"
                    WidthRequest="150"
                    Value="4"/>
                
                <Label
                    x:Name="nbstacks"
                    TextColor="{DynamicResource WhiteColor}"
                    FontSize="16"
                    VerticalTextAlignment="Center"
                    HorizontalTextAlignment="Center"/>

            </StackLayout>

            <StackLayout
                Grid.Row="2"
                Orientation="Horizontal">
                <Label
                    Text="{x:Static resources:AppResources.StrNbCards}"
                    TextColor="{DynamicResource WhiteColor}"
                    FontSize="16"
                    VerticalTextAlignment="Center"
                    HorizontalTextAlignment="Center"/>

                <Slider
                    x:Name="SelectNbCard"
                    Maximum="100"
                    Minimum="40"
                    ThumbColor="{DynamicResource SkyBlueColor}"
                    ValueChanged="ChangedNbCards"
                    HorizontalOptions="Center"
                    VerticalOptions="Center"
                    WidthRequest="150"
                    Value="100"/>

                <Label                    
                    TextColor="{DynamicResource WhiteColor}"
                    FontSize="16"
                    x:Name="nbCard"
                    VerticalTextAlignment="Center"
                    HorizontalTextAlignment="Center"/>

            </StackLayout>

        </Grid>

        <ScrollView
            Grid.Column="0"
            Grid.ColumnSpan="2"
            Grid.Row="1">

            <StackLayout
                x:Name="NameList">

                <Label
                    Text="{x:Static resources:AppResources.StrPseudoGM}"
                    TextColor="{DynamicResource WhiteColor}"
                    FontSize="16"
                    VerticalTextAlignment="Center"
                    HorizontalTextAlignment="Center"/>
                
                <Entry
                    BackgroundColor="{DynamicResource Gold}"                    
                    Placeholder="Pseudo"
                    HorizontalOptions="Center"
                    MinimumWidthRequest="50"
                    WidthRequest="200"
                    MaxLength="18"
                    x:Name="FirstEntry"
                    TextColor="Black"
                    IsTextPredictionEnabled="False"/>

            </StackLayout>
        </ScrollView>

    </Grid>

</ContentPage>
