Stub + début collection biding

devGuillaume
Yoan BRUGIÈRE 2 years ago
parent 6ddf773bdf
commit 1d624184e1

@ -17,6 +17,7 @@ namespace Model
public string Forces { get; set; } public string Forces { get; set; }
public string Faiblesses { get; set; } public string Faiblesses { get; set; }
public List<Personnage> Utilisateur { get; set; }= new List<Personnage>(); public List<Personnage> Utilisateur { get; set; }= new List<Personnage>();
public string? Image { get; set; }
public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses) public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses)
{ {
@ -30,6 +31,10 @@ namespace Model
Faiblesses = faiblesses; Faiblesses = faiblesses;
} }
public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses,string image) : this(nom, nomRomanise, type, premierChap, premierEp, description, forces, faiblesses)
{
Image = image;
}
public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses, List<Personnage> utilisateur) : this( nom, nomRomanise, type, premierChap, premierEp, description, forces, faiblesses) public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses, List<Personnage> utilisateur) : this( nom, nomRomanise, type, premierChap, premierEp, description, forces, faiblesses)
{ {
Utilisateur = utilisateur; Utilisateur = utilisateur;

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Stub
{
public static class StubFruitDuDemon
{
public static IEnumerable<FruitDuDemon> RecupererFruit()
{
List<FruitDuDemon> fdd = new List<FruitDuDemon>()
{
};
return fdd;
}
}
}

@ -13,8 +13,8 @@
<ShellContent <ShellContent
ContentTemplate="{DataTemplate local:NewPage2}" ContentTemplate="{DataTemplate local:NewPage3}"
Route="NewPage2" /> Route="NewPage3" />
</Shell> </Shell>

@ -53,8 +53,32 @@
<Label Text="Trier" HorizontalTextAlignment="Center" /> <Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame> </Frame>
</Grid> </Grid>
<ScrollView Orientation="Vertical" VerticalScrollBarVisibility="Always">
<ScrollView BackgroundColor="Red" Orientation="Vertical" VerticalScrollBarVisibility="Always" >
<CollectionView x:Name="listFDD" IsGrouped="True">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="10">
<Image Grid.RowSpan="2"
Source="{Binding ImageUrl}"
Aspect="AspectFill"
HeightRequest="60"
WidthRequest="60" />
<Label Grid.Column="1"
Text="{Binding Name}"
FontAttributes="Bold" />
<Label Grid.Row="1"
Grid.Column="1"
Text="{Binding Location}"
FontAttributes="Italic"
VerticalOptions="End" />
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ScrollView> </ScrollView>
</VerticalStackLayout> </VerticalStackLayout>
</Grid> </Grid>

@ -1,10 +1,17 @@
namespace Ohara; namespace Ohara;
using Model;
using Model.Stub;
public partial class NewPage3 : ContentPage public partial class NewPage3 : ContentPage
{ {
public NewPage3() public NewPage3()
{ {
InitializeComponent(); InitializeComponent();
List<FruitDuDemon> fdd = StubFruitDuDemon.RecupererFruit().ToList();
listeFDD.ItemsSource = fdd;
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

@ -409,7 +409,6 @@
<Setter Property="FontSize" Value="20"/> <Setter Property="FontSize" Value="20"/>
<Setter Property="TextColor" Value="White"/> <Setter Property="TextColor" Value="White"/>
<Setter Property="CornerRadius" Value="0"/> <Setter Property="CornerRadius" Value="0"/>
<Setter Property="WidthRequest" Value="250"/> <Setter Property="WidthRequest" Value="250"/>
</Style> </Style>
@ -427,7 +426,6 @@
<Setter Property="FontSize" Value="20"/> <Setter Property="FontSize" Value="20"/>
<Setter Property="TextColor" Value="White"/> <Setter Property="TextColor" Value="White"/>
<Setter Property="CornerRadius" Value="0"/> <Setter Property="CornerRadius" Value="0"/>
<Setter Property="WidthRequest" Value="275" /> <Setter Property="WidthRequest" Value="275" />
</Style> </Style>

@ -2,7 +2,7 @@
using Model; using Model;
FruitDuDemon nika = new FruitDuDemon("Fruit de l'humain modèle Nika", "Nika Nika No Mi", "Zoan Mythologique", 1, 1, "Le fruit ...", "Forces :", "Faiblesses :"); FruitDuDemon nika = new FruitDuDemon("Fruit de l'humain modèle Nika", "Nika Nika No Mi", "Zoan Mythologique", 1, 1, "Le fruit ...", "Forces :", "Faiblesses :");
FruitDuDemon fumer = new FruitDuDemon("Fruit de la fumée", "Moku Moky No Mi", "Logia", 50, 50, "Le fruit est ..", "Forces :", "Faiblesses :", "fumer.png");
Personnage luffy = new Personnage("Monkey D. Luffy", "Chapeau de paille", 19,1.74,"East Blue","Monkey D. Luffy est...","Le Roi des Pirates ce sera moi !" ); Personnage luffy = new Personnage("Monkey D. Luffy", "Chapeau de paille", 19,1.74,"East Blue","Monkey D. Luffy est...","Le Roi des Pirates ce sera moi !" );
Personnage zoro = new Personnage("Roronoa Zoro", "Chasseur de pirates", 21, 1.81, "East Blue", "Roronoa Zoro est ...", "Le plus grand des racistes ce sera moi !"); Personnage zoro = new Personnage("Roronoa Zoro", "Chasseur de pirates", 21, 1.81, "East Blue", "Roronoa Zoro est ...", "Le plus grand des racistes ce sera moi !");
Personnage sanji = new Personnage("Sanji", "La jambe noire", 21, 1.80, "East Blue", "Sanji né Vinsmoke Sanji ..", "As-tu déjà entendu parler de All Blue ?"); Personnage sanji = new Personnage("Sanji", "La jambe noire", 21, 1.80, "East Blue", "Sanji né Vinsmoke Sanji ..", "As-tu déjà entendu parler de All Blue ?");

Loading…
Cancel
Save