<?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"
             x:Class="Linaris.AlbumPage"
             xmlns:local="clr-namespace:Linaris"
             Title="Album"
             Style="{StaticResource PageFlyoutTrigger}">

    <Grid Style="{StaticResource GridFlyoutTrigger}">
        <Grid.RowDefinitions>
            <RowDefinition Height="8*"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        
        <local:Layout Grid.Column="0"/>

        <ScrollView Grid.Column="1"
                             BackgroundColor="#404040">
            <VerticalStackLayout>
                
                <SearchBar Style="{StaticResource SearchBar}"/>

                <Grid VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Style="{StaticResource InfosComplementairesGridTrigger}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="6*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <VerticalStackLayout Grid.Column="0">
                        <Frame IsClippedToBounds="True" CornerRadius="75" HeightRequest="150" WidthRequest="150" HorizontalOptions="Center" VerticalOptions="Center" BackgroundColor="Transparent">
                            <Image Source="{Binding ImageURL}" Aspect="AspectFill" WidthRequest="150" HeightRequest="150" Margin="-20"/>
                        </Frame>
                        <Label Text="{Binding Name}"
                                Style="{StaticResource Titre}">
                        </Label>
                        <Label Text="{Binding Description}"
                               Style="{StaticResource SousTitre}">
                        </Label>

                        <ListView ItemsSource="{Binding Titles}">
                            <ListView.ItemTemplate>
                                <DataTemplate>
                                    <ViewCell>
                                        <Frame Style="{StaticResource Song}">
                                            <Label Text="{Binding Name}"
                                               FontSize="20"
                                               TextColor="white"
                                               HorizontalTextAlignment="Center"/>
                                        </Frame>
                                    </ViewCell>
                                </DataTemplate>
                            </ListView.ItemTemplate>
                        </ListView>

                    </VerticalStackLayout>
                    <ScrollView Grid.Column="1" VerticalOptions="Fill" BackgroundColor="gray">
                        <VerticalStackLayout HorizontalOptions="Fill">
                            <Label Text="Informations complémentaires" TextColor="{StaticResource Blue200Accent}" FontSize="16" HorizontalTextAlignment="Center" FontAttributes="Bold" HorizontalOptions="Center" Margin="0,0,0,10"/>
                            <Label TextColor="White" HorizontalOptions="Center" VerticalOptions="End" Text="{Binding Information}"/>
                        </VerticalStackLayout>
                    </ScrollView>
                </Grid>

            </VerticalStackLayout>

        </ScrollView>
        
        <local:FooterPage Grid.Row="1" Grid.ColumnSpan="2"/>

    </Grid>

</ContentPage>