créations de personnages + alignement horizontal lorsqu'un nouveau personnage est créé + scroll view des personnages (tout en cs)

devGuillaume
Guillaume REY 2 years ago
parent 23c69d0b1a
commit a2aaa888da

@ -3,6 +3,7 @@
public class Personnage
{
public string Nom { get; set; }
public double Prime { get; set; }
public string Epithete { get; set; }
public int Age { get; set; }
public double Taille { get; set; }
@ -15,9 +16,10 @@
public Personnage(string nom, string epithete, int age, double taille, string origine, string biographie, string citation, string image)
public Personnage(string nom, double prime, string epithete, int age, double taille, string origine, string biographie, string citation, string image)
{
Nom = nom;
Prime = prime;
Epithete = epithete;
Age = age;
Taille = taille;
@ -27,7 +29,7 @@
Image = image;
}
public Personnage(string nom, string epithete, int age, double taille, string origine, string biographie, string citation,string image ,Equipage equipage,List<FruitDuDemon> fruit) : this(nom,epithete,age,taille,origine,biographie,citation,image)
public Personnage(string nom, double prime, string epithete, int age, double taille, string origine, string biographie, string citation,string image ,Equipage equipage,List<FruitDuDemon> fruit) : this(nom,prime,epithete,age,taille,origine,biographie,citation,image)
{
Equipage = equipage;
Fruit = fruit;

@ -12,8 +12,10 @@ namespace Model.Stub
{
List<Personnage> perso = new List<Personnage>()
{
new Personnage("Luffy", "Luffy au Chapeau de Paille", 19,1.74, "East Blue", "Feu Clé Noir", "Jean Neymar", "luffy.png"),
new Personnage("Luffy", 3000000000,"Luffy au Chapeau de Paille", 19, 1.74, "East Blue", "Monkey D. Luffy est...", "Le Roi des Pirates, ce sera moi !", "luffy.png"),
new Personnage("Nami", 366000000, "Le Chatte Voleuse", 20, 1.70, "East Blue", "Nami est...", "Je n'aime que deux choses, l'argent et les mandarines !!", "nami.png"),
new Personnage("Usopp", 500000000,"Dieu Usopp", 19, 1.76, "East Blue", "Usopp est...", "Je suis le grand capitaine Usopp ! J'ai 8 000 hommes sous mon commandement ! C'est moi qui fait la loi sur cette île ! Je vous préviens, quittez ce village pendant qu'il est encore temps sinon vous aurez à faire à moi et à mes hommes!", "usopp.png"),
new Personnage("Zoro", 1111000000,"Le Chasseur de Pirates", 21, 1.81, "East Blue", "Zoro est...", "Un coup dans le dos est le déshonneur pour un sabreur !", "zoro.png"),
};
return perso;
}

@ -57,6 +57,12 @@
</ItemGroup>
<ItemGroup>
<Compile Update="PageCarte.xaml.cs">
<DependentUpon>PageCarte.xaml</DependentUpon>
</Compile>
<Compile Update="PageBateau.xaml.cs">
<DependentUpon>PageBateau.xaml</DependentUpon>
</Compile>
<Compile Update="PagePersonnage.xaml.cs">
<DependentUpon>PagePersonnage.xaml</DependentUpon>
</Compile>
@ -69,7 +75,7 @@
</ItemGroup>
<ItemGroup>
<MauiXaml Update="NewPage1.xaml">
<MauiXaml Update="PageCarte.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="PagePersonnage.xaml">
@ -81,7 +87,7 @@
<MauiXaml Update="PageEquipage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="NewPage4.xaml">
<MauiXaml Update="PageBateau.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
</ItemGroup>

@ -36,89 +36,91 @@
<VerticalStackLayout Grid.Row="0" Grid.Column="1" Spacing="40">
<Grid BackgroundColor="#72a3b3" Padding="10" ColumnSpacing="50" >
<Grid.RowDefinitions>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions >
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="25*"/>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<SearchBar Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="2">
<Label Text="Filtrer" HorizontalTextAlignment="Center" />
</Frame>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="3">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
<Grid BackgroundColor="#72a3b3" Padding="10" ColumnSpacing="50" >
<Grid.RowDefinitions>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions >
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="25*"/>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<SearchBar Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="2">
<Label Text="Filtrer" HorizontalTextAlignment="Center" />
</Frame>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="3">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
</Grid>
<CollectionView x:Name="listePerso" ItemsUpdatingScrollMode="KeepScrollOffset" VerticalScrollBarVisibility="Always" >
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="50" ColumnSpacing="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="600"/>
</Grid.RowDefinitions>
<Image
Source="{Binding Image}"
HeightRequest="800"
WidthRequest="450"
/>
<Frame CornerRadius="20"
BorderColor="#72a3b3"
BackgroundColor="#72a3b3"
Margin="20, 50" Padding="20"
WidthRequest="275"
HeightRequest="150"
Grid.Row="0"
VerticalOptions="End">
<StackLayout Orientation="Vertical" Spacing="20">
<Label
Text="{Binding Nom}"
FontAttributes="Bold"
FontSize="22"
TextColor="White"
HorizontalOptions="Center"
/>
<Label
Text="________________________"
FontAttributes="Bold"
FontSize="20"
TextColor="White"
HorizontalOptions="Center"
<ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always">
<CollectionView x:Name="listePerso" ItemsLayout="HorizontalList">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="50" ColumnSpacing="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="750"/>
</Grid.RowDefinitions>
<Image
Source="{Binding Image}"
HeightRequest="800"
WidthRequest="450"
/>
<Label
Text="Cliquez ici pour voir en détail"
FontAttributes="Bold,Italic"
FontSize="15"
TextColor="White"
TextDecorations="Underline"
HorizontalOptions="Center"/>
</StackLayout>
</Frame>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<Frame CornerRadius="20"
BorderColor="#72a3b3"
BackgroundColor="#72a3b3"
Margin="20, 50" Padding="20"
WidthRequest="275"
HeightRequest="150"
Grid.Row="0"
VerticalOptions="End">
<StackLayout Orientation="Vertical" Spacing="20">
<Label
Text="{Binding Nom}"
FontAttributes="Bold"
FontSize="22"
TextColor="White"
HorizontalOptions="Center"
/>
<Label
Text="________________________"
FontAttributes="Bold"
FontSize="20"
TextColor="White"
HorizontalOptions="Center"
/>
<Label
Text="Cliquez ici pour voir en détail"
FontAttributes="Bold,Italic"
FontSize="15"
TextColor="White"
TextDecorations="Underline"
HorizontalOptions="Center"/>
</StackLayout>
</Frame>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ScrollView>
</VerticalStackLayout>

Loading…
Cancel
Save