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/App.xaml

66 lines
3.6 KiB

<?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Stim"
x:Class="Stim.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
<DataTemplate x:Key="tagsTemplate">
<Label Padding="5,0,0,0" Margin="0" Text="{Binding}"/>
</DataTemplate>
<DataTemplate x:Key="gameTemplate">
<Border MinimumWidthRequest="200" Margin="10, 10, 10, 10">
<Grid HeightRequest="635" RowDefinitions="auto, auto, auto">
<Image Source="{Binding Cover}" Aspect="AspectFit" Margin="0,0,0,0" WidthRequest="900" HeightRequest="455"/>
<Label FontAttributes="Bold" FontSize="30" Text="{Binding Name}" Grid.Row="1" HorizontalTextAlignment="Center"/>
<Grid Grid.Row="2" ColumnDefinitions="*, auto" RowDefinitions="auto, auto">
<Label Text="Tags :" Margin="0" Padding="0"/>
<CollectionView ItemsSource="{Binding Tags}" Grid.Row="1" Margin="0" ItemTemplate="{StaticResource tagsTemplate}"/>
<Label Text="{Binding Year}" Grid.Row="1" Grid.Column="2" HorizontalTextAlignment="End" VerticalTextAlignment="End"/>
</Grid>
</Grid>
</Border>
</DataTemplate>
<DataTemplate x:Key="reviewTemplate">
<VerticalStackLayout>
<HorizontalStackLayout> <!--CONVERTER-->
<Label Text="{Binding AuthorName}" FontSize="20"/>
</HorizontalStackLayout>
<Label Text="{Binding Text}"/>
</VerticalStackLayout>
</DataTemplate>
<DataTemplate x:Key="followTemplate">
<Border HeightRequest="150" Margin="10">
<Grid ColumnDefinitions="auto, *, 3*, auto" RowDefinitions="*">
<Image Source="{Binding Cover}"/>
<Label Grid.Column="1" Text="{Binding Name}" FontSize="50"/>
<ScrollView Grid.Column="2">
<Label Text="{Binding Description}"/>
</ScrollView>
<CollectionView Grid.Column="3" ItemsSource="{Binding Tags}" Grid.Row="1" Margin="0" ItemTemplate="{StaticResource tagsTemplate}" HorizontalOptions="End"/>
</Grid>
</Border>
</DataTemplate>
<DataTemplate x:Key="followLoginTemplate">
<Grid Margin="10" ColumnDefinitions="*, 5*, *">
<Border>
<Image Source="{Binding Cover}" Grid.Column="0" HeightRequest="100"/>
</Border>
<Border Grid.Column="1">
<Label Text="{Binding Name}"/>
</Border>
<Border Grid.Column="2">
<Label Text="X" FontSize="50"/>
</Border>
</Grid>
</DataTemplate>
</ResourceDictionary>
</Application.Resources>
</Application>