ajout de fall back values + style sur profilpage

Popup_qui_marche_pas
Anthony RICHARD 2 years ago
parent 83fbe2c23b
commit 1d503d9733

@ -2,8 +2,8 @@
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Stim"
xmlns:conv="clr-namespace:Stim.Converter"
x:Class="Stim.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
@ -11,21 +11,19 @@
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
<conv:DoubleToStar x:Key="DoubleToStar" EtoilePleine="etoile_pleine.png" EtoileMiPleine="etoile_mi_pleine.png" EtoileVide="etoile_vide.png"/>
<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"/>
<Image Source="{Binding Cover, FallbackValue='no_cover.png'}" Aspect="AspectFit" Margin="0,0,0,0" WidthRequest="900" HeightRequest="455"/>
<Label FontAttributes="Bold" FontSize="30" Text="{Binding Name, FallbackValue='Default'}" 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"/>
<Label Text="{Binding Year, FallbackValue='2023'}" Grid.Row="1" Grid.Column="2" HorizontalTextAlignment="End" VerticalTextAlignment="End"/>
</Grid>
</Grid>
</Border>
@ -34,27 +32,20 @@
<Border Margin="0, 5">
<VerticalStackLayout>
<Grid ColumnDefinitions="auto, *">
<Label Text="{Binding AuthorName}" FontSize="20"/>
<HorizontalStackLayout Grid.Column="1" HorizontalOptions="End">
<Label Text="{Binding Rate, StringFormat='{0}/5'}" FontSize="20"/>
<Image Style="{StaticResource star}" Source="{Binding Rate, Converter={StaticResource DoubleToStar}, ConverterParameter='1'}"/>
<Image Style="{StaticResource star}" Source="{Binding Rate, Converter={StaticResource DoubleToStar}, ConverterParameter='2'}"/>
<Image Style="{StaticResource star}" Source="{Binding Rate, Converter={StaticResource DoubleToStar}, ConverterParameter='3'}"/>
<Image Style="{StaticResource star}" Source="{Binding Rate, Converter={StaticResource DoubleToStar}, ConverterParameter='4'}"/>
<Image Style="{StaticResource star}" Source="{Binding Rate, Converter={StaticResource DoubleToStar}, ConverterParameter='5'}"/>
</HorizontalStackLayout>
<Label Text="{Binding AuthorName, FallbackValue='Default'}" FontSize="20"/>
<local:StarsContainer Rate="{Binding Rate, FallbackValue='0'}" Grid.Column="2"/>
</Grid>
<Label Text="{Binding Text}"/>
<Label Text="{Binding Text, FallbackValue='Default'}"/>
</VerticalStackLayout>
</Border>
</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"/>
<Image Source="{Binding Cover, FallbackValue='no_cover.png'}"/>
<Label Grid.Column="1" Text="{Binding Name, FallbackValue='Default'}" FontSize="50"/>
<ScrollView Grid.Column="2">
<Label Text="{Binding Description}"/>
<Label Text="{Binding Description, FallbackValue='Default'}"/>
</ScrollView>
<CollectionView Grid.Column="3" ItemsSource="{Binding Tags}" Grid.Row="1" Margin="0" ItemTemplate="{StaticResource tagsTemplate}" HorizontalOptions="End"/>
</Grid>
@ -63,10 +54,10 @@
<DataTemplate x:Key="followLoginTemplate">
<Grid Margin="10" ColumnDefinitions="*, 5*, *">
<Border>
<Image Source="{Binding Cover}" Grid.Column="0" HeightRequest="100"/>
<Image Source="{Binding Cover, FallbackValue='no_cover.png'}" Grid.Column="0" HeightRequest="100"/>
</Border>
<Border Grid.Column="1">
<Label Text="{Binding Name}"/>
<Label Text="{Binding Name, FallbackValue='Default'}"/>
</Border>
<Border Grid.Column="2">
<Label Text="X" FontSize="50"/>

@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Stim"
x:Class="Stim.DetailledPage"
Title="{Binding Name}"
Title="{Binding Name, FallbackValue='Default'}"
Background="{StaticResource Secondary}">
<Grid>
@ -16,17 +16,17 @@
<VerticalStackLayout Style="{StaticResource pageBorder}" Grid.Column="2"/>
<Grid Background="{StaticResource Tertiary}" Grid.Column="1" ColumnDefinitions="*, *, *, *" RowDefinitions="auto, *, auto, auto, auto">
<Image Grid.RowSpan="4" Margin="5, 0, 0, 0" Source="{Binding Cover}" Aspect="AspectFit"/>
<Label Grid.Column="1" Text="{Binding Name}" FontSize="30"/>
<Label Grid.Column="2" Text="{Binding Year}" HorizontalOptions="Center"/>
<Button Grid.Column="3" Margin="10" Text="Suivre" HorizontalOptions="Center"
VerticalOptions="Center" Background="transparent" CornerRadius="0" BorderWidth="3" BorderColor="{StaticResource Secondary}" Clicked="AddFollow"/>
<Image Grid.RowSpan="4" Margin="5, 0, 0, 0" Source="{Binding Cover, FallbackValue='no_cover.png'}" Aspect="AspectFit"/>
<Label Grid.Column="1" Text="{Binding Name, FallbackValue='Default'}" FontSize="30"/>
<Label Grid.Column="2" Text="{Binding Year, FallbackValue='2023'}" HorizontalOptions="Center"/>
<ImageButton Grid.Column="3" Style="{StaticResource removeButton}" Clicked="RemoveGame" HorizontalOptions="Start"/>
<Button Grid.Column="4" Style="{StaticResource followButton}" Clicked="AddFollow"/>
<ScrollView Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="1">
<Label Text="{Binding Description}"/>
<ScrollView Grid.Column="1" Grid.ColumnSpan="4" Grid.Row="1">
<Label Text="{Binding Description, FallbackValue='Default'}"/>
</ScrollView>
<Grid Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="2" RowDefinitions="auto, auto">
<Grid Grid.Column="1" Grid.ColumnSpan="4" Grid.Row="2" RowDefinitions="auto, auto">
<Label Text="Tags :"/>
<CollectionView Grid.Row="1" ItemsSource="{Binding Tags}" ItemTemplate="{StaticResource tagsTemplate}"/>
</Grid>
@ -34,7 +34,7 @@
<Label Grid.Column="1" Grid.Row="3" Text="{Binding Lien, FallbackValue='Default'}"/>
<local:StarsContainer Rate="{Binding Average, FallbackValue='0'}" Grid.Column="4" Grid.Row="3"/>
<VerticalStackLayout Grid.ColumnSpan="4" Grid.Row="4">
<Label Text="Avis de la communauté :" FontSize="30"/>
<CollectionView ItemsSource="{Binding Reviews}" ItemTemplate="{StaticResource reviewTemplate}"/>

@ -7,10 +7,10 @@
<ScrollView>
<Grid BackgroundColor="#495057" ColumnDefinitions="*, 5*, *" RowDefinitions="auto, *">
<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"/>
<VerticalStackLayout Style="{StaticResource pageBorder}" Grid.Column="0"/>
<VerticalStackLayout Style="{StaticResource pageBorder}" Grid.Column="2"/>
<VerticalStackLayout Style="{StaticResource pageBorder}" Grid.Column="0" Grid.Row="1"/>
<VerticalStackLayout Style="{StaticResource pageBorder}" Grid.Column="2" Grid.Row="1"/>
<Grid Grid.Column="1" Grid.Row="1" Margin="0,10,100,0" ColumnDefinitions="*, *">
<VerticalStackLayout Grid.Column="0" Margin="10,0,0,0">

@ -80,6 +80,9 @@
<MauiXaml Update="AddGamePage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ConfirmationPopup.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="DetailledPage - Copier.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
@ -98,6 +101,9 @@
<MauiXaml Update="MessagePopup.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="StarsContainer.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="UserInfo.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>

Loading…
Cancel
Save