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 class Personnage
{ {
public string Nom { get; set; } public string Nom { get; set; }
public double Prime { get; set; }
public string Epithete { get; set; } public string Epithete { get; set; }
public int Age { get; set; } public int Age { get; set; }
public double Taille { 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; Nom = nom;
Prime = prime;
Epithete = epithete; Epithete = epithete;
Age = age; Age = age;
Taille = taille; Taille = taille;
@ -27,7 +29,7 @@
Image = image; 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; Equipage = equipage;
Fruit = fruit; Fruit = fruit;

@ -12,8 +12,10 @@ namespace Model.Stub
{ {
List<Personnage> perso = new List<Personnage>() 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; return perso;
} }

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

@ -56,8 +56,8 @@
</Frame> </Frame>
</Grid> </Grid>
<ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always">
<CollectionView x:Name="listePerso" ItemsUpdatingScrollMode="KeepScrollOffset" VerticalScrollBarVisibility="Always" > <CollectionView x:Name="listePerso" ItemsLayout="HorizontalList">
<CollectionView.ItemTemplate> <CollectionView.ItemTemplate>
<DataTemplate> <DataTemplate>
@ -66,9 +66,10 @@
<ColumnDefinition Width="400"/> <ColumnDefinition Width="400"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="600"/> <RowDefinition Height="750"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Image <Image
Source="{Binding Image}" Source="{Binding Image}"
HeightRequest="800" HeightRequest="800"
@ -119,6 +120,7 @@
</DataTemplate> </DataTemplate>
</CollectionView.ItemTemplate> </CollectionView.ItemTemplate>
</CollectionView> </CollectionView>
</ScrollView>
</VerticalStackLayout> </VerticalStackLayout>

Loading…
Cancel
Save