<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:UserInfo="clr-namespace:Stim"
             x:Class="Stim.ProfilPage"
             Title="Profil">
    <ScrollView>

        <Grid BackgroundColor="#495057">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="5*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>


            <VerticalStackLayout BackgroundColor="Black" Grid.Column="0"/>
            <VerticalStackLayout BackgroundColor="Black" Grid.Column="2"/>
            <VerticalStackLayout BackgroundColor="Black" Grid.Column="0" Grid.Row="1"/>
            <VerticalStackLayout BackgroundColor="Black" Grid.Column="2" Grid.Row="1"/>

            <Grid Grid.Column="1" Grid.Row="1" Margin="0,10,100,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <VerticalStackLayout Grid.Column="0" Margin="10,0,0,0">
                    <Image Source="{Binding CurrentUser.UserImage}" HeightRequest="200" WidthRequest="200" Margin="0,0,10,0"/>
                    <UserInfo:UserInfo Bind="{Binding CurrentUser.Username}"/>

                    <Grid Margin="0,20,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="10*"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Border>
                            <Label Text="{Binding CurrentUser.Biographie}" HeightRequest="200" HorizontalTextAlignment="Start" VerticalTextAlignment="Start"/>
                        </Border>
                        <Button ImageSource="pen.png" Grid.Column="1" MaximumHeightRequest="32" MaximumWidthRequest="32" Padding="0,0,0,0" Margin="5,0,0,0" BackgroundColor="{StaticResource Gray500}"></Button>
                    </Grid>
                    <Grid Margin="0,20,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="10*"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Border Margin="0,10,0,0" Padding="0">  
                            <Label Text="**********"/>
                        </Border>
                        <Button ImageSource="pen.png" Grid.Column="1" MaximumHeightRequest="32" MaximumWidthRequest="32" Padding="0,0,0,0" Margin="5,0,0,0" BackgroundColor="{StaticResource Gray500}"></Button>
                    </Grid>
                    <UserInfo:UserInfo Bind="{Binding CurrentUser.Email}"/>

                </VerticalStackLayout>
                
                <VerticalStackLayout Grid.Column="1" Margin="100,0,0,0">
                    <Label HorizontalOptions="Center" Text="Mes suivis"/>
                    <ScrollView>
                        <Border>
                            <CollectionView ItemsSource="{Binding CurrentUser.Followed_Games}" SelectionMode="Single" SelectionChanged="CollectionView_SelectionChanged" ItemTemplate="{StaticResource followLoginTemplate}"/>
                        </Border>
                    </ScrollView>
                </VerticalStackLayout>
            </Grid>
        </Grid>
    </ScrollView>
</ContentPage>