You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Projet_IHM/Sources/Stim/MainPage.xaml

88 lines
5.2 KiB

<?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="Stim.MainPage"
Title="Accueil"
Background="{StaticResource Secondary}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ScrollView>
<Grid BackgroundColor="{StaticResource Tertiary}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<VerticalStackLayout BackgroundColor="{StaticResource Secondary}" Grid.Column="0"/>
<VerticalStackLayout BackgroundColor="{StaticResource Secondary}" Grid.Column="2"/>
<VerticalStackLayout BackgroundColor="{StaticResource Secondary}" Grid.Column="0" Grid.Row="1"/>
<VerticalStackLayout BackgroundColor="{StaticResource Secondary}" Grid.Column="2" Grid.Row="1"/>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<SearchBar x:Name="Game" TextChanged="SearchBar_GameChanged" Grid.ColumnSpan="2" Placeholder="Rechercher un jeu" Margin="5"/>
<SearchBar x:Name="Tag1" TextChanged="SearchBar_GameChanged" Grid.Column="0" Grid.Row="1" Placeholder="Tag 1" WidthRequest="200" HorizontalOptions="End" Margin="5"/>
<SearchBar x:Name="Tag2" TextChanged="SearchBar_GameChanged" Grid.Column="1" Grid.Row="1" Placeholder="Tag 2" WidthRequest="200" HorizontalOptions="Start" Margin="5"/>
</Grid>
<CollectionView ItemsSource="{Binding ResearchedGame}" SelectionMode="Single" SelectionChanged="OnClickGameList" ItemsLayout="VerticalGrid, 3" Grid.Column="1" Grid.Row="1">
<CollectionView.ItemTemplate>
<DataTemplate>
<Border MinimumWidthRequest="200" Margin="10, 10, 10, 10">
<Grid HeightRequest="950">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Image Source="{Binding Cover}" Aspect="AspectFit" Margin="0,0,0,0" WidthRequest="900" HeightRequest="750"/>
<Label FontAttributes="Bold" FontSize="30" Text="{Binding Name}" Grid.Row="1" HorizontalTextAlignment="Center"/>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Label Text="Tags :"/>
<CollectionView ItemsSource="{Binding Tags}" Grid.Row="1" Grid.ColumnSpan="2">
<CollectionView.ItemTemplate>
<DataTemplate>
<Label Padding="10,0,0,0" Text="{Binding}"/>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<Label Text="{Binding Year}" Grid.Row="1" Grid.Column="2" HorizontalTextAlignment="End" VerticalTextAlignment="End"/>
</Grid>
</Grid>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ScrollView>
<ImageButton Source="add_white.png" Background="transparent" WidthRequest="50" HeightRequest="50" HorizontalOptions="End" VerticalOptions="End" Margin="0, 0, 10, 10" Clicked="GoToAddGamePage"/>
</Grid>
</ContentPage>