Merge branch 'devYoan'
continuous-integration/drone/push Build is failing Details

devGuillaume
Yoan 2 years ago
commit 6485cffabe

@ -12,17 +12,69 @@ namespace Model.Classes
public class Bateau : ObjetOhara
{
[DataMember(Name = "nomromanise")]
public string NomRomanise { get; set; }
private string nomromanise;
public string NomRomanise {
get=>nomromanise;
set
{
if(nomromanise == value) return;
nomromanise = value;
}
}
[DataMember(Name = "affiliation", EmitDefaultValue = false)]
public Equipage? Affiliation { get; set; }
private Equipage? equipage;
public Equipage? Affiliation {
get=>equipage;
set
{
if(equipage == value) return;
equipage = value;
}
}
[DataMember(Name = "premierchap")]
public int PremierChap { get; set; }
private int premierchap;
public int PremierChap
{
get => premierchap;
set
{
if (premierchap == value) return;
premierchap = value;
}
}
[DataMember(Name = "premierep")]
public int PremierEp { get; set; }
private int premierep;
public int PremierEp
{
get => premierep;
set
{
if (premierep == value) return;
premierep = value;
}
}
[DataMember(Name = "description")]
public string Description { get; set; }
private string description;
public string Description
{
get => description;
set
{
if (description == value) return;
description = value;
}
}
[DataMember(Name = "caracteristique")]
public string Caracteristique { get; set; }
private string caracteristique;
public string Caracteristique {
get=> caracteristique;
set
{
if(caracteristique == value) return;
caracteristique = value;
}
}
public Bateau(string nom, string nomRomanise, int premierChap, int premierEp, string description, string caracteristique) : base(nom)

@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
@ -10,14 +12,43 @@ using System.Xml.Linq;
namespace Model.Classes
{
[DataContract(Name = "bestiaire")]
public class Bestiaire : ObjetOhara
public class Bestiaire : ObjetOhara, INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;
[DataMember(Name = "origine")]
public string Origine { get; set; }
private string origine;
public string Origine {
get=>origine;
set
{
if (origine == value) return;
origine = value;
OnPropertyChanged();
}
}
[DataMember(Name = "description")]
public string Description { get; set; }
private string description;
public string Description {
get=>description;
set
{
if (description == value) return;
description = value;
OnPropertyChanged();
}
}
[DataMember(Name = "caracteristique")]
public string Caracteristique { get; set; }
private string caracteristique;
public string Caracteristique {
get=>caracteristique;
set
{
if(caracteristique == value) return;
caracteristique = value;
OnPropertyChanged();
}
}
public Bestiaire(string nom, string origine, string description, string caracteristique) : base(nom)
{
@ -55,5 +86,7 @@ namespace Model.Classes
return "Bestiaire :" + Nom +" "+EstFavori+ " " + Origine + " " + Description + " " + Caracteristique +" " + Image;
}
void OnPropertyChanged([CallerMemberName] string propertyName = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
@ -9,7 +10,7 @@ using System.Xml.Linq;
namespace Model.Classes
{
[DataContract(Name = "fruitdudemon")]
public class FruitDuDemon : ObjetOhara
public class FruitDuDemon : ObjetOhara,INotifyPropertyChanged
{
[DataMember(Name = "nomromanise")]
public string NomRomanise { get; set; }
@ -28,7 +29,7 @@ namespace Model.Classes
[DataMember(Name = "utilisateur", EmitDefaultValue = false)]
public List<Personnage> Utilisateur { get; set; } = new List<Personnage>();
public event PropertyChangedEventHandler? PropertyChanged;
public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses) : base(nom)
{
@ -67,6 +68,8 @@ namespace Model.Classes
Utilisateur = utilisateur;
}
public override bool Equals(object? obj)
{
if (obj == null) return false;
@ -91,5 +94,13 @@ namespace Model.Classes
{
return "FruitDuDemon :" + Nom +" " +EstFavori+" " + NomRomanise + " " + Type + " " + PremierChap + " " + PremierEp + " " + Description + " " + Forces +" "+Faiblesses+ " " + Image;
}
void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
}

@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
@ -9,20 +11,79 @@ using System.Xml.Linq;
namespace Model.Classes
{
[DataContract(Name = "ile")]
public class Ile : ObjetOhara
public class Ile : ObjetOhara, INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;
[DataMember(Name = "nomromanise")]
public string NomRomanise { get; set; }
private string nomromanise;
public string NomRomanise
{
get => nomromanise;
set
{
if (nomromanise == value) return;
nomromanise = value;
OnPropertyChanged();
}
}
[DataMember(Name = "region")]
public string Region { get; set; }
private string region;
public string Region {
get=>region;
set
{
if (region == value) return;
region = value;
OnPropertyChanged();
}
}
[DataMember(Name = "premierchap")]
public int PremierChap { get; set; }
private int premierchap;
public int PremierChap {
get=>premierchap;
set
{
if(premierchap == value) return;
premierchap = value;
OnPropertyChanged();
}
}
[DataMember(Name = "premierep")]
public int PremierEp { get; set; }
private int premierep;
public int PremierEp {
get=>premierep;
set
{
if(premierep == value) return;
premierep = value;
OnPropertyChanged();
}
}
[DataMember(Name = "description")]
public string Description { get; set; }
private string description;
public string Description {
get=>description;
set
{
if (description == value) return;
description = value;
OnPropertyChanged();
}
}
[DataMember(Name = "geographie")]
public string Geographie { get; set; }
private string geographie;
public string Geographie {
get=>geographie;
set
{
if (geographie == value) return;
geographie = value;
OnPropertyChanged();
}
}
@ -61,6 +122,10 @@ namespace Model.Classes
public override bool Equals(object? obj)
{
if (obj == null) return false;
if (this.GetType() != obj.GetType())
{
return false;
}
else
{
Ile o = (Ile)obj;
@ -79,5 +144,8 @@ namespace Model.Classes
{
return "Ile :"+ Nom +" "+NomRomanise+" "+Region+" "+PremierChap+" "+PremierEp+" "+Description+" "+Geographie+" "+Image;
}
void OnPropertyChanged([CallerMemberName] string propertyName = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}

@ -1,31 +1,75 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Model.Classes
{
[DataContract(Name = "objetohara")]
public class ObjetOhara
public class ObjetOhara : INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;
[DataMember(Name = "nom")]
public string Nom { get; set; }
private string nom;
public string Nom {
get => nom;
set
{
if (nom == value)
{
return;
}
nom = value;
OnPropertyChanged();
}
}
[DataMember(Name = "image")]
public string? Image { get; set; }
private string? image;
public string? Image {
get => image;
set
{
if (image == value)
return;
image = value;
OnPropertyChanged();
}
}
[DataMember(Name = "estfavori")]
public bool EstFavori { get; set; }
private bool estfavori;
public bool EstFavori {
get=>estfavori;
set
{
if (estfavori == value)
return;
estfavori = value;
}
}
public ObjetOhara(string nom, string image = "baseimage.png", bool estFavori = false)
{
Nom = nom;
Image = image;
EstFavori = estFavori;
}
public override bool Equals(object? obj)
{
if (obj == null) return false;
@ -50,6 +94,9 @@ namespace Model.Classes
{
return "ObjetOhara :" + Nom + " " +EstFavori+ " " + Image;
}
void OnPropertyChanged([CallerMemberName] string propertyName = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}

@ -3,24 +3,113 @@
namespace Model.Classes
{
[DataContract(Name = "personnage")]
public class Personnage : ObjetOhara
{
[DataMember(Name = "prime")]
public double Prime { get; set; }
private double prime;
public double Prime {
get=>prime;
set
{
if (prime == value)
{
return;
}
prime = value;
}
}
[DataMember(Name = "epithete")]
public string Epithete { get; set; }
private string epithete;
public string Epithete {
get=>epithete;
set
{
if (epithete == value)
{
return;
}
epithete = value;
}
}
[DataMember(Name = "age")]
public int Age { get; set; }
private int age;
public int Age {
get=>age;
set
{
if (age == value)
{
return;
}
age = value;
}
}
[DataMember(Name = "taille")]
public double Taille { get; set; }
private double taille;
public double Taille {
get=>taille;
set
{
if (taille == value)
{
return;
}
taille = value;
}
}
[DataMember(Name = "origine")]
public string Origine { get; set; }
private string origine;
public string Origine {
get=>origine;
set
{
if (origine == value)
{
return;
}
origine = value;
}
}
[DataMember(Name = "biographie")]
public string Biographie { get; set; }
private string biographie;
public string Biographie {
get=>biographie;
set
{
if (biographie == value)
{
return;
}
biographie = value;
}
}
[DataMember(Name = "citation")]
public string Citation { get; set; }
private string citation;
public string Citation {
get=>citation;
set
{
if (citation == value)
{
return;
}
citation = value;
}
}
[DataMember(Name = "equipage", EmitDefaultValue = false)]
public Equipage? Equipage { get; set; }
private Equipage equipage;
public Equipage Equipage {
get => equipage;
set
{
if (equipage == value)
{
return;
}
equipage = value;
}
}
[DataMember(Name = "fruit", EmitDefaultValue = false)]
public List<FruitDuDemon> Fruit { get; set; } = new List<FruitDuDemon>();

@ -64,47 +64,31 @@ namespace Model.Managers
public List<FruitDuDemon> FiltrerFDD(string type)
{
List<FruitDuDemon> fdd = GetFruits();
foreach (FruitDuDemon f in fdd.ToList())
{
if (f.Type != type)
{
fdd.Remove(f);
}
}
List<FruitDuDemon> fdd = new List<FruitDuDemon>();
fdd=Fruits.Where(p=>p.Type==type).ToList();
return fdd;
}
public List<FruitDuDemon> RechercheFDD(string text, List<FruitDuDemon> listeFDD)
public List<Bateau> FiltrerBateau(string nom)
{
if (text == "")
{
return listeFDD;
}
foreach (FruitDuDemon f in listeFDD.ToList())
{
bool correspondance = false;
int textPos = 0;
for (int i = 0; i < f.Nom.Length; i++)
{
if (string.Equals(text[textPos].ToString(), f.Nom[i].ToString(), StringComparison.OrdinalIgnoreCase))
{
textPos++;
}
if (textPos == text.Length)
{
correspondance = true;
break;
}
List<Bateau> bateau = new List<Bateau>();
bateau = Bateaux.Where(p => p.Affiliation?.Nom == nom).ToList();
return bateau;
}
}
if (!correspondance)
{
listeFDD.Remove(f);
}
}
return listeFDD;
public List<Ile> FiltrerIle(string region)
{
List<Ile> ile = new List<Ile>();
ile = Iles.Where(p => p.Region == region).ToList();
return ile;
}
public List<ObjetOhara> FiltrerFavs(string type)
{
List<ObjetOhara> favs = GetFavoris();
return favs;
}
public List<ObjetOhara> RechercheObjetOhara(string text, List<ObjetOhara> liste)
{
if (text == "")
@ -154,72 +138,157 @@ namespace Model.Managers
return listeFavoris;
}
public void ModifierFavoris(ObjetOhara obj,bool value)
public void ModifierFavFDD(FruitDuDemon fruit,bool value)
{
Type t = obj.GetType();
if (t.Equals(typeof(Bateau)))
foreach(Bateau b in Bateaux)
foreach (FruitDuDemon b in Fruits)
{
if (b.Equals(fruit))
{
if (b.Equals(obj))
{
b.EstFavori = value;
DataManager.SetBateau(Bateaux.ToList());
}
b.EstFavori = value;
DataManager.SetFDD(Fruits.ToList());
}
else if (t.Equals(typeof(Equipage)))
foreach (Equipage b in Equipages)
}
}
public void ModifierFavEquip(Equipage equip, bool value)
{
foreach (Equipage b in Equipages)
{
if (b.Equals(equip))
{
if (b.Equals(obj))
{
b.EstFavori = value;
DataManager.SetEquipage(Equipages.ToList());
}
b.EstFavori = value;
DataManager.SetEquipage(Equipages.ToList());
}
else if (t.Equals(typeof(Personnage)))
foreach (Personnage b in Personnages)
}
}
public void ModifierFavBest(Bestiaire best, bool value)
{
foreach (Bestiaire b in Bestiaire)
{
if (b.Equals(best))
{
if (b.Equals(obj))
{
b.EstFavori = value;
DataManager.SetPersonnage(Personnages.ToList());
}
b.EstFavori = value;
DataManager.SetBestiaire(Bestiaire.ToList());
}
else if (t.Equals(typeof(Ile)))
foreach (Ile b in Iles)
}
}
public void ModifierFavPerso(Personnage perso, bool value)
{
foreach (Personnage b in Personnages)
{
if (b.Equals(perso))
{
if (b.Equals(obj))
{
b.EstFavori = value;
DataManager.SetIle(Iles.ToList());
}
b.EstFavori = value;
DataManager.SetPersonnage(Personnages.ToList());
}
else if (t.Equals(typeof(FruitDuDemon)))
foreach (FruitDuDemon b in Fruits)
}
}
public void ModifierFavIle(Ile ile, bool value)
{
foreach (Ile b in Iles)
{
if (b.Equals(ile))
{
if (b.Equals(obj))
{
b.EstFavori = true;
DataManager.SetFDD(Fruits.ToList());
}
b.EstFavori = value;
DataManager.SetIle(Iles.ToList());
}
else if (t.Equals(typeof(Bestiaire)))
foreach (Bestiaire b in Bestiaire)
}
}
public void ModifierFavBateau(Bateau bateau, bool value)
{
foreach (Bateau b in Bateaux)
{
if (b.Equals(bateau))
{
if (b.Equals(obj))
{
b.EstFavori = value;
DataManager.SetBestiaire(Bestiaire.ToList());
}
b.EstFavori = value;
DataManager.SetBateau(Bateaux.ToList());
}
}
}
public void AjouterFDD(FruitDuDemon fruit)
{
Fruits.Add(fruit);
}
public void AjouterEquip(Equipage equip)
{
Equipages.Add(equip);
}
public void AjouterBest(Bestiaire best)
{
Bestiaire.Add(best);
}
public void AjouterPerso(Personnage perso)
{
Personnages.Add(perso);
}
public void AjouterIle(Ile ile)
{
Iles.Add(ile);
}
public void AjouterBateau(Bateau bateau)
{
Bateaux.Add(bateau);
}
public void SupprimerFDD(FruitDuDemon fruit)
{
Fruits.Remove(fruit);
}
public void SupprimerEquip(Equipage equip)
{
Equipages.Remove(equip);
}
public void SupprimerBest(Bestiaire best)
{
Bestiaire.Remove(best);
}
public void SupprimerPerso(Personnage perso)
{
Personnages.Remove(perso);
}
public void SupprimerIle(Ile ile)
{
Iles.Remove(ile);
}
public void SupprimerBateau(Bateau bateau)
{
Bateaux.Remove(bateau);
}
public void ModifierIle(Ile ile, string ancienNom)
{
Ile? ancienneIle = Iles.FirstOrDefault(p => p.Nom == ancienNom);
if (ancienneIle == null) return;
Iles.Remove(ancienneIle);
Iles.Add(ile);
}
public void ModifierBest(Bestiaire best, string ancienNom)
{
Bestiaire? ancienBest = Bestiaire.FirstOrDefault(p => p.Nom == ancienNom);
if (ancienBest == null) return;
Bestiaire.Remove(ancienBest);
Bestiaire.Add(best);
}
public void ModifierEquipage(Equipage equip, string ancienNom)
{
Equipage? ancienEquip = Equipages.FirstOrDefault(p => p.Nom == ancienNom);
if (ancienEquip == null) return;
Equipages.Remove(ancienEquip);
Equipages.Add(equip);
}
public void ModifierBateau(Bateau bateau, string ancienNom)
{
Bateau? ancienBateau = Bateaux.FirstOrDefault(p => p.Nom == ancienNom);
if (ancienBateau == null) return;
Bateaux.Remove(ancienBateau);
Bateaux.Add(bateau);
}
public void ModifierFDD(FruitDuDemon fruit, string ancienNom)
{
FruitDuDemon? ancienFDD = Fruits.FirstOrDefault(p => p.Nom == ancienNom);
if (ancienFDD == null) return;
Fruits.Remove(ancienFDD);
Fruits.Add(fruit);
}
}
}

@ -12,11 +12,21 @@ namespace Model.Stub
{
public IEnumerable<Bateau> RecupererBateau()
{
Bateau sunny = new Bateau("Sunny", "Sauzando Sani-go", 435, 321, "Le Thousand Sunny est...", "Ce bateau a pour particularités ...", "sunny.png");
Bateau merry =new Bateau("Vogue Merry", "Goingu Merri-go", 41, 17, "Le Vogue Merry est...", "Ce bateau a pour particularités ...", "vogue_merry.png");
Bateau moby = new Bateau("Moby Dick", "Mobi Dikku-go", 234, 151, "Le Moby Dick est...", "Ce bateau a pour particularités ...", "moby_dick.png");
StubEquipage stubEquipage = new StubEquipage();
StubPersonnage stubPersonnage = new StubPersonnage();
stubEquipage.ChargerEquipage(stubPersonnage.RecupererPersonnage().ToList());
List<Equipage> equipages = stubEquipage.RecupererEquipage().ToList();
sunny.Affiliation = equipages.FirstOrDefault(p => p.Nom == "Équipage au chapeau de paille");
merry.Affiliation = equipages.FirstOrDefault(p => p.Nom == "Équipage au chapeau de paille");
moby.Affiliation = equipages.FirstOrDefault(p => p.Nom == "Équipage de Barbe Blanche");
List<Bateau> bateau = new List<Bateau>()
{
new Bateau("Sunny", "Sauzando Sani-go", 435, 321, "Le Thousand Sunny est...", "Ce bateau a pour particularités ...", "sunny.png"),
new Bateau("Vogue Merry", "Goingu Merri-go", 41, 17, "Le Vogue Merry est...", "Ce bateau a pour particularités ...", "vogue_merry.png"),
new Bateau("Moby Dick", "Mobi Dikku-go", 234, 151, "Le Moby Dick est...", "Ce bateau a pour particularités ...", "moby_dick.png"),
sunny,
merry,
moby,
};
return bateau;
}

@ -1,26 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Classes;
namespace Model.Stub
{
public class StubBestiaire
{
public IEnumerable<Bestiaire> RecupererBestiaire()
{
List<Bestiaire> best = new List<Bestiaire>()
{
new Bestiaire("Humains", "??", "Les humains sont ...","Ils possèdent les caractéristiques suivantes ...","humain.png"),
new Bestiaire("Géants", "Elbaf", "Les géants sont ...","Ils possèdent les caractéristiques suivantes ...","geant.png"),
new Bestiaire("Hommes poissons", "Îles des hommes poissons", "Les hommes poissons sont ...","Ils possèdent les caractéristiques suivantes ...","hpoisson.png"),
new Bestiaire("Lunariens", "Redline", "Les lunariens sont ...","Ils possèdent les caractéristiques suivantes ...","lunarien.png"),
new Bestiaire("Minks", "Zo", "Les minks sont ...","Ils possèdent les caractéristiques suivantes ...","minks.png"),
};
return best;
}
}
}
namespace Model.Stub
{
public class StubBestiaire
{
public IEnumerable<Bestiaire> RecupererBestiaire()
{
List<Bestiaire> best = new List<Bestiaire>()
{
new Bestiaire("Humains", "??", "Les humains sont ...","Ils possèdent les caractéristiques suivantes ...","humain.png"),
new Bestiaire("Géants", "Elbaf", "Les géants sont ...","Ils possèdent les caractéristiques suivantes ...","geant.png"),
new Bestiaire("Hommes poissons", "Îles des hommes poissons", "Les hommes poissons sont ...","Ils possèdent les caractéristiques suivantes ...","hpoisson.png"),
new Bestiaire("Lunariens", "Redline", "Les lunariens sont ...","Ils possèdent les caractéristiques suivantes ...","lunarien.png"),
new Bestiaire("Minks", "Zo", "Les minks sont ...","Ils possèdent les caractéristiques suivantes ...","minks.png"),
};
return best;
}
}
}

@ -9,27 +9,39 @@ namespace Model.Stub
{
public class StubEquipage
{
public IEnumerable<Equipage> RecupererEquipage()
public List<Equipage> Equipages { get; set; }
public void ChargerEquipage(List<Personnage> persos)
{
List<Equipage> Lequipage = new List<Equipage>()
var paille = new Equipage("Équipage au chapeau de paille", "Mugiwara No Ichimi", "East Blue", 1, 1, true, "L'équipage du Chapeau de Paille ...", "mugiwara.jpg");
var roux = new Equipage("Équipage du Roux", "Akagami Kalzokudan", "East Blue", 1, 4, true, "L'équipage du Roux ...", "roux.png");
var clown = new Equipage("Équipage du Clown", "Bagï Kalzokudan", "East Blue", 8, 4, true, "L'équipage du Clown ...", "clown.png");
var blanche = new Equipage("Équipage de Barbe Blanche", "Shirohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Blanche ...", "blanche.jpg");
var noire = new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...", "noire.png");
paille.Allie.Add(clown);
paille = RemplirEquipage(paille, persos, new List<string> { "Luffy" });
Equipages = new List<Equipage>()
{
new Equipage("Équipage au chapeau de paille", "Mugiwara No Ichimi", "East Blue", 1, 1, true, "L'équipage du Chapeau de Paille ...","mugiwara.jpg"),
new Equipage("Équipage du Roux", "Akagami Kalzokudan", "East Blue", 1, 4, true, "L'équipage du Roux ...","roux.png"),
new Equipage("Équipage du Clown", "Bagï Kalzokudan", "East Blue", 8, 4, true, "L'équipage du Clown ...","clown.png"),
new Equipage("Équipage de Barbe Blanche", "Shirohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Blanche ...","blanche.jpg"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
paille,
roux,
clown,
blanche,
};
return Lequipage;
}
public IEnumerable<Equipage> RecupererEquipage()
{
return Equipages;
}
public Equipage RemplirEquipage(Equipage equipage,List<Personnage> persos,List<string> noms)
{
var persos2 = persos.Where(p => noms.Contains(p.Nom));
equipage.Membre.AddRange(persos2);
return equipage;
}
}
}

@ -15,8 +15,8 @@ namespace Model.Stub
List<Ile> ile = new List<Ile>()
{
new Ile("Dawn", "Don-to", "East Blue", 1, 4, "L'île de Dawn est ...", "Cette île est situé dans la mer d'East Blue près de ...", "dawn.png"),
new Ile("Water Seven", "Mizu no Miyako Wōtā Sebun", "Première partie de Grand Line", 323, 229, "Water Seven est ...", "Cette île est situé dans la première partie de Grand Line près de ...", "water_seven.png"),
new Ile("Alabsta", "Arabasuta-Ōkoku'", "Première partie de Grand Line", 113, 78, "L'île d'Alabsta est ...", "Cette île est situé dans la première partie de Grand Line près de ...", "alabasta.png"),
new Ile("Water Seven", "Mizu no Miyako Wōtā Sebun", "Grand Line", 323, 229, "Water Seven est ...", "Cette île est situé dans la première partie de Grand Line près de ...", "water_seven.png"),
new Ile("Alabsta", "Arabasuta-Ōkoku'", "Grand Line", 113, 78, "L'île d'Alabsta est ...", "Cette île est situé dans la première partie de Grand Line près de ...", "alabasta.png"),
};
return ile;
}

@ -21,7 +21,6 @@ namespace Model.Stub
public StubManager()
{
StubPersonnage = new StubPersonnage();
StubFruitDuDemon = new StubFruitDuDemon();
StubEquipage = new StubEquipage();
@ -32,7 +31,8 @@ namespace Model.Stub
public IEnumerable<Personnage> GetPersonnages()
{
{
return StubPersonnage.RecupererPersonnage();
}
@ -42,6 +42,7 @@ namespace Model.Stub
}
public IEnumerable<Equipage> GetEquipages()
{
StubEquipage.ChargerEquipage(StubPersonnage.RecupererPersonnage().ToList());
return StubEquipage.RecupererEquipage();
}
public IEnumerable<Bateau> GetBateaux()

@ -10,16 +10,59 @@ namespace Model.Stub
{
public class StubPersonnage
{
public IEnumerable<Personnage> RecupererPersonnage()
{
List<Personnage> perso = new List<Personnage>()
var luffy = new Personnage("Luffy", 3000000000, "Luffy au Chapeau de Paille", 19, 1.74, "East Blue", "Monkey D. Luffy (モンキー・D・ルフィ, Monkī Dī Rufi) est un pirate et le principal protagoniste du manga et anime One Piece. Luffy est le fils du chef de l'Armée Révolutionnaire, Monkey D. Dragon, le petit-fils du célèbre héros de la Marine, Monkey D. Garp, le fils adoptif d'une bandit des montagnes, Curly Dadan ainsi que le frère adoptif du défunt Portgas D. Ace et de Sabo.\n\nSon rêve le plus cher est de devenir le Seigneur des Pirates en trouvant le trésor légendaire One Piece, caché quelque part dans le monde par Gol D. Roger. Selon lui, ce rêve se concrétisera, en devenant la personne la plus libre qui soit. Il a mangé par erreur un Fruit du Démon, le Gomu Gomu no Mi, qui lui permet d'être un homme-élastique, que l'Équipage du Roux avait pris à un convoi du Gouvernement Mondial.\n\n En tant que fondateur et Capitaine de l'Équipage du Chapeau de Paille, il est le premier membre à en faire partie. C'est également le fondateur involontaire de la Grande Flotte du Chapeau de Paille, même s'il refuse cependant d'en être le Capitaine, ne désirant pas priver les autres de leur liberté. ", "\"Le Roi des Pirates, ce sera moi !\"", "luffy.png");
var nami = new Personnage("Nami", 366000000, "Le Chatte Voleuse", 20, 1.70, "East Blue", "Nami, alias La Chatte Voleuse (泥棒猫, Dorobō Neko), est la navigatrice de L'Équipage du Chapeau de Paille. Elle est la deuxième personne à se joindre à l'équipage après Zoro. Elle a brièvement trahi l'Équipage du Chapeau de Paille pendant l'Arc Baratie et les rejoignit officiellement à la fin de l'Arc d'Arlong après que son passé et ses intentions furent révélés. Son rêve est de dessiner une carte complète du monde. Sa prime actuelle s'élève à 366 000 000 berry.", "\"Je n'aime que deux choses, l'argent et les mandarines !!\"", "nami.png");
var usopp = new Personnage("Usopp", 500000000, "Dieu Usopp", 19, 1.76, "East Blue", "Usopp (ウソップ, Usoppu), également nommé Pipo dans les anciennes éditions de Glénat du manga, est un membre de L'Équipage du Chapeau de Paille, il occupe le poste de Tireur d'Élite. Il est originaire du Village de Sirop. Bien que n'étant pas Charpentier Naval, il s'occupait également de réparer le Vogue Merry (dont il colmatait les trous avec les moyens du bord). Il est ensuite remplacé par Franky, lorsque ce dernier et le Thousand Sunny rejoignirent l'équipage, pour ce qui est de l'entretien du navire.\n\nLorsquil était au Village de Sirop, il était le Capitaine de l'Équipage du Capitaine Usopp et était connu par les membres de son équipage comme le Capitaine Usopp (船長ウソップ, Kyaputen Usoppu). Il a d'ailleurs gardé ce pseudonyme qui fait partie de ses répliques cultes. Il a dissous l'équipage lorsqu'il est parti en mer et qu'il a rejoint l'Équipage du Chapeau de Paille. Il est le fils de Yasopp, membre de l'Équipage du Roux.\n\nSon rêve est de devenir un valeureux guerrier des mers, et de suivre les traces de son père, et il estime qu'il pourra mourir tranquille lorsqu'il l'aura réalisé. Il pourra alors se dire : \"C'est moi Usopp !! Le preux guerrier des mers!!\".\n\nAlors que sa prime initiale était seulement de 30 000 000 berrys (sous le pseudonyme de Sogeking (そげキング, Sogekingu)) avant l'ellipse, celle-ci a drastiquement augmenté, allant jusqu'à 200 000 000 de berry(sous le pseudonyme de God Usopp (神ウソップ, Goddo Usoppu)) suite aux événements de l'Arc Dressrosa, puis 500.000.000 de berry après les événements de l'Arc Pays des Wa. ", "\"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");
var zoro = new Personnage("Zoro", 1111000000, "Le Chasseur de Pirates", 21, 1.81, "East Blue", "Roronoa Zoro le Chasseur de Pirates est un pirate, un ex-chasseur de pirates et l'un des protagonistes de One Piece.\n\nIl fut le premier membre à rejoindre l'Équipage du Chapeau de Paille, il en est le premier et principal épéiste. Son ambition est de devenir le meilleur sabreur au monde et il a d'ailleurs montré une volonté de fer dans le but d'y parvenir. C'est un maître escrimeur qui peut utiliser plusieurs styles de combat dont la particularité repose sur le nombre d'épées, ses capacités au combat sont telles qu'il donne parfois l'impression aux personnes extérieures à l'équipage d'être le véritable Capitaine.\n\nZoro fait partie des Onze Supernovas avec sa prime de 120 000 000 de berry qu'il a obtenu avant ellipse, il est ainsi l'une des deux personnes du groupe à être Supernova sans pour autant être capitaine d'équipage. Après l'ellipse, suite aux événements de Dressrosa, il possède une prime de 320 000 000 de berry, ce qui en fait la quatrième plus grosse prime de l'équipage. Après les événements de l'Arc Pays des Wa, sa prime monte ensuite à 1.111.000.000 de berry.\n\nIl est né dans East Blue, Zoro étant le fils de Tera et Roronoa Arashi, et le petit-fils de Shimotsuki Furiko et Roronoa Pinzoro, faisant de lui un descendant de la Fami lleShimotsuki du Pays des Wa.", "\"Un coup dans le dos est le déshonneur pour un sabreur !\"", "zoro.png");
var robin = new Personnage("Robin", 1111000000, "", 21, 1.81, "East Blue", "", "\"Un coup dans le dos est le déshonneur pour un sabreur !\"", "robin.jpg");
var chopper = new Personnage("Chopper", 1111000000, "", 21, 1.81, "East Blue", "", "\"Un coup dans le dos est le déshonneur pour un sabreur !\"", "chopper.jpg");
var brook = new Personnage("Brook", 1111000000, "", 21, 1.81, "East Blue", "", "\"Un coup dans le dos est le déshonneur pour un sabreur !\"", "brook.png");
StubEquipage stubEquipage = new StubEquipage();
StubFruitDuDemon stubFruitDuDemon = new StubFruitDuDemon();
List<FruitDuDemon> fruits = new List<FruitDuDemon>(stubFruitDuDemon.RecupererFruit());
luffy.Fruit.AddRange(fruits.Where(p => p.Nom == "Fruit de l'humain modèle Nika"));
robin.Fruit.AddRange(fruits.Where(p => p.Nom == "Fruit des Éclosions"));
List<Personnage> persos = new List<Personnage>()
{
new Personnage("Luffy", 3000000000,"Luffy au Chapeau de Paille", 19, 1.74, "East Blue", "Monkey D. Luffy (モンキー・D・ルフィ, Monkī Dī Rufi) est un pirate et le principal protagoniste du manga et anime One Piece. Luffy est le fils du chef de l'Armée Révolutionnaire, Monkey D. Dragon, le petit-fils du célèbre héros de la Marine, Monkey D. Garp, le fils adoptif d'une bandit des montagnes, Curly Dadan ainsi que le frère adoptif du défunt Portgas D. Ace et de Sabo.\n\nSon rêve le plus cher est de devenir le Seigneur des Pirates en trouvant le trésor légendaire One Piece, caché quelque part dans le monde par Gol D. Roger. Selon lui, ce rêve se concrétisera, en devenant la personne la plus libre qui soit. Il a mangé par erreur un Fruit du Démon, le Gomu Gomu no Mi, qui lui permet d'être un homme-élastique, que l'Équipage du Roux avait pris à un convoi du Gouvernement Mondial.\n\n En tant que fondateur et Capitaine de l'Équipage du Chapeau de Paille, il est le premier membre à en faire partie. C'est également le fondateur involontaire de la Grande Flotte du Chapeau de Paille, même s'il refuse cependant d'en être le Capitaine, ne désirant pas priver les autres de leur liberté. ", "\"Le Roi des Pirates, ce sera moi !\"", "luffy.png"),
new Personnage("Nami", 366000000, "Le Chatte Voleuse", 20, 1.70, "East Blue", "Nami, alias La Chatte Voleuse (泥棒猫, Dorobō Neko), est la navigatrice de L'Équipage du Chapeau de Paille. Elle est la deuxième personne à se joindre à l'équipage après Zoro. Elle a brièvement trahi l'Équipage du Chapeau de Paille pendant l'Arc Baratie et les rejoignit officiellement à la fin de l'Arc d'Arlong après que son passé et ses intentions furent révélés. Son rêve est de dessiner une carte complète du monde. Sa prime actuelle s'élève à 366 000 000 berry.", "\"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 (ウソップ, Usoppu), également nommé Pipo dans les anciennes éditions de Glénat du manga, est un membre de L'Équipage du Chapeau de Paille, il occupe le poste de Tireur d'Élite. Il est originaire du Village de Sirop. Bien que n'étant pas Charpentier Naval, il s'occupait également de réparer le Vogue Merry (dont il colmatait les trous avec les moyens du bord). Il est ensuite remplacé par Franky, lorsque ce dernier et le Thousand Sunny rejoignirent l'équipage, pour ce qui est de l'entretien du navire.\n\nLorsquil était au Village de Sirop, il était le Capitaine de l'Équipage du Capitaine Usopp et était connu par les membres de son équipage comme le Capitaine Usopp (船長ウソップ, Kyaputen Usoppu). Il a d'ailleurs gardé ce pseudonyme qui fait partie de ses répliques cultes. Il a dissous l'équipage lorsqu'il est parti en mer et qu'il a rejoint l'Équipage du Chapeau de Paille. Il est le fils de Yasopp, membre de l'Équipage du Roux.\n\nSon rêve est de devenir un valeureux guerrier des mers, et de suivre les traces de son père, et il estime qu'il pourra mourir tranquille lorsqu'il l'aura réalisé. Il pourra alors se dire : \"C'est moi Usopp !! Le preux guerrier des mers!!\".\n\nAlors que sa prime initiale était seulement de 30 000 000 berrys (sous le pseudonyme de Sogeking (そげキング, Sogekingu)) avant l'ellipse, celle-ci a drastiquement augmenté, allant jusqu'à 200 000 000 de berry(sous le pseudonyme de God Usopp (神ウソップ, Goddo Usoppu)) suite aux événements de l'Arc Dressrosa, puis 500.000.000 de berry après les événements de l'Arc Pays des Wa. ", "\"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", "Roronoa Zoro le Chasseur de Pirates est un pirate, un ex-chasseur de pirates et l'un des protagonistes de One Piece.\n\nIl fut le premier membre à rejoindre l'Équipage du Chapeau de Paille, il en est le premier et principal épéiste. Son ambition est de devenir le meilleur sabreur au monde et il a d'ailleurs montré une volonté de fer dans le but d'y parvenir. C'est un maître escrimeur qui peut utiliser plusieurs styles de combat dont la particularité repose sur le nombre d'épées, ses capacités au combat sont telles qu'il donne parfois l'impression aux personnes extérieures à l'équipage d'être le véritable Capitaine.\n\nZoro fait partie des Onze Supernovas avec sa prime de 120 000 000 de berry qu'il a obtenu avant ellipse, il est ainsi l'une des deux personnes du groupe à être Supernova sans pour autant être capitaine d'équipage. Après l'ellipse, suite aux événements de Dressrosa, il possède une prime de 320 000 000 de berry, ce qui en fait la quatrième plus grosse prime de l'équipage. Après les événements de l'Arc Pays des Wa, sa prime monte ensuite à 1.111.000.000 de berry.\n\nIl est né dans East Blue, Zoro étant le fils de Tera et Roronoa Arashi, et le petit-fils de Shimotsuki Furiko et Roronoa Pinzoro, faisant de lui un descendant de la Famille Shimotsuki du Pays des Wa.", "\"Un coup dans le dos est le déshonneur pour un sabreur !\"", "zoro.png"),
luffy,
nami,
usopp,
zoro,
robin,
chopper,
brook,
};
return perso;
//stubEquipage.ChargerEquipage(persos);
//List<Equipage> equipages = new List<Equipage>(stubEquipage.RecupererEquipage());
//var equip = equipages.Where(p => p.Nom == "Équipage au chapeau de paille");
//luffy.Equipage.AddRange(equip);
//nami.Equipage.AddRange(equip);
//usopp.Equipage.AddRange(equip);
//zoro.Equipage.AddRange(equip);
//robin.Equipage.AddRange(equip);
//brook.Equipage.AddRange(equip);
//chopper.Equipage.AddRange(equip);
//List<Personnage> persos2 = new List<Personnage>()
//{
// luffy,
// nami,
// usopp,
// zoro,
// robin,
// chopper,
// brook,
//};
return persos;
}
}
}

@ -12,7 +12,18 @@ public partial class App : Application
public App()
{
InitializeComponent();
MainPage = new AppShell();
Routing.RegisterRoute(nameof(PageInfoIle), typeof(PageInfoIle));
Routing.RegisterRoute(nameof(PageInfoBateau), typeof(PageInfoBateau));
Routing.RegisterRoute(nameof(PageInfoBestiaire), typeof(PageInfoBestiaire));
Routing.RegisterRoute(nameof(PageInfoEquipage), typeof(PageInfoEquipage));
Routing.RegisterRoute(nameof(PageInfoFdd), typeof(PageInfoFdd));
Routing.RegisterRoute(nameof(PageInfoPersonnage), typeof(PageInfoPersonnage));
Routing.RegisterRoute(nameof(ModalIle), typeof(ModalIle));
Routing.RegisterRoute(nameof(ModalBestiaire), typeof(ModalBestiaire));
Routing.RegisterRoute(nameof(ModalFDD), typeof(ModalFDD));
Routing.RegisterRoute(nameof(ModalPersonnage), typeof(ModalPersonnage));
Routing.RegisterRoute(nameof(ModalEquipage), typeof(ModalEquipage));
Routing.RegisterRoute(nameof(ModalBateau), typeof(ModalBateau));
MainPage = new AppShell();
}
}

@ -4,11 +4,64 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Ohara"
Shell.FlyoutBehavior="Locked"
Shell.NavBarIsVisible="False"
Shell.FlyoutWidth="300"
>
<Shell.Resources>
<Style TargetType="Layout"
ApplyToDerivedTypes="True"
Class="FlyoutItemLayoutStyle">
<Setter Property="WidthRequest" Value="1000"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="White"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="#72a3b3"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="Shell">
<Setter Property="FlyoutBackgroundColor" Value="White"/>
</Style>
<Style TargetType="Label"
ApplyToDerivedTypes="True"
Class="FlyoutItemLayoutStyle">
<Setter Property="WidthRequest" Value="1000"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="TextColor" Value="#72a3b3"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="TextColor" Value="White"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
</Shell.Resources>
<Shell.TitleView>
<Label/>
</Shell.TitleView>
@ -23,18 +76,54 @@
</Shell.FlyoutHeader>
<ShellContent Title="Accueil" ContentTemplate="{DataTemplate local:MainPage}" />
<ShellContent Title="Favoris" ContentTemplate="{DataTemplate local:PageFavoris}" />
<ShellContent Title="Carte" ContentTemplate="{DataTemplate local:PageCarte}" />
<ShellContent Title="Personnages" ContentTemplate="{DataTemplate local:PagePersonnage}" />
<ShellContent Title="Bateaux" ContentTemplate="{DataTemplate local:PageBateau}" />
<ShellContent Title="Îles" ContentTemplate="{DataTemplate local:PageIle}" />
<ShellContent Title="Fruits Du Démon" ContentTemplate="{DataTemplate local:PageFDD}" />
<ShellContent Title="Equipages" ContentTemplate="{DataTemplate local:PageEquipage}" />
<ShellContent Title="Bestiaire" ContentTemplate="{DataTemplate local:PageBestiaire}" />
<FlyoutItem Title="Accueil" >
<ShellContent ContentTemplate="{DataTemplate local:MainPage}" />
</FlyoutItem>
<FlyoutItem Title="Favoris">
<FlyoutItem.Icon>
<FontImageSource
FontFamily="Icons"
Glyph="\ue72c"
Color="#72a3b3"
Size="16"/>
</FlyoutItem.Icon>
<ShellContent ContentTemplate="{DataTemplate local:PageFavoris}" />
</FlyoutItem>
<FlyoutItem Title="Carte">
<ShellContent ContentTemplate="{DataTemplate local:PageCarte}" />
</FlyoutItem>
<FlyoutItem Title="Personnages">
<ShellContent ContentTemplate="{DataTemplate local:PagePersonnage}" />
</FlyoutItem>
<FlyoutItem Title="Bateaux">
<ShellContent ContentTemplate="{DataTemplate local:PageBateau}" />
</FlyoutItem>
<FlyoutItem Title="Îles" >
<ShellContent ContentTemplate="{DataTemplate local:PageIle}" />
</FlyoutItem>
<FlyoutItem Title="Fruits Du Démon">
<ShellContent ContentTemplate="{DataTemplate local:PageFDD}" />
</FlyoutItem>
<FlyoutItem Title="Equipages">
<ShellContent ContentTemplate="{DataTemplate local:PageEquipage}" />
</FlyoutItem>
<FlyoutItem Title="Bestiaire">
<ShellContent ContentTemplate="{DataTemplate local:PageBestiaire}" />
</FlyoutItem>
<Shell.FlyoutFooter>
<Label Text="REY Guillaume et BRUGIÈRE Yoan" HorizontalOptions="Center" Margin="10"/>
<StackLayout>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="4" Stroke="#72a3b3"/>
<Label Text="REY Guillaume et BRUGIÈRE Yoan" HorizontalOptions="Center" Margin="10" TextColor="#72a3b3"/>
</StackLayout>
</Shell.FlyoutFooter>
</Shell>

@ -5,7 +5,7 @@
BackgroundColor="#e2edf1">
<ScrollView>
<VerticalStackLayout Grid.Row="0" Grid.Column="1" Spacing="40" Margin="0,20,0,0">
<Frame CornerRadius="20" Margin="150,0,150,0" HeightRequest="75">
<Frame CornerRadius="20" HorizontalOptions="Center" Padding="30" BorderColor="Transparent">
<Label Text="Bienvenue dans Ohara !" FontAttributes="Bold" FontSize="30" HorizontalOptions="Center" TextColor="White"/>
<Frame.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
@ -14,12 +14,17 @@
</LinearGradientBrush>
</Frame.Background>
</Frame>
<Frame CornerRadius="20" BorderColor="#72a3b3" BackgroundColor="#72a3b3" Padding="20" HeightRequest="500" Margin="50,0,50,0">
<Label Text="Présentation :" FontAttributes="Bold" FontSize="30" HorizontalOptions="Center" TextColor="White"/>
</Frame>
<Frame CornerRadius="20" BorderColor="#72a3b3" BackgroundColor="#72a3b3" Padding="20" HeightRequest="500" Margin="50,0,50,0" >
<Label Text="Nouveautés : ..." FontAttributes="Bold" FontSize="30" HorizontalOptions="Start" TextColor="White"/>
<Frame CornerRadius="20" Padding="20" HorizontalOptions="Center" BackgroundColor="#72a3b3" BorderColor="#72a3b3" Margin="50">
<VerticalStackLayout Spacing="10">
<Label Text="Présentation :" FontAttributes="Bold" FontSize="30" HorizontalOptions="Center" VerticalOptions="Start" TextColor="White"/>
<Label TextColor="White" Grid.Column="1" FontSize="17" VerticalOptions="Center" HorizontalTextAlignment="Center" >
<Label.Text>
Ohara est le nom d'une île dans le manga One Piece, écrit par Eiichiro Oda. Cette île abritait de nombreux archéologues qui cherchaient à déceler les mystères du monde.
Nous avons choisi le nom Ohara pour notre projet lié à la SAE 2.01, car notre application représente une véritable encyclopédie rassemblant des informations sur One Piece.
Avec des centaines de personnages, des dizaines d'îles et de nombreux arcs d'histoire, il peut être difficile de se souvenir de tous les détails. Notre application a été conçue pour aider les fans à accéder facilement à toutes les informations sur One Piece,en offrant une expérience utilisateur fluide et intuitive.
</Label.Text>
</Label>
</VerticalStackLayout>
</Frame>
</VerticalStackLayout>
</ScrollView>

@ -17,7 +17,8 @@ public static class MauiProgram
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
fonts.AddFont("microns.ttf", "Icons");
});
#if DEBUG
builder.Logging.AddDebug();

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.ModalBateau"
Title="ModalBateau"
BackgroundColor="#e2edf1"
Shell.PresentationMode="ModalAnimated">
<ScrollView>
<FlexLayout AlignItems="End" Wrap="Wrap" Direction="Row" JustifyContent="Center" HorizontalOptions="Center" VerticalOptions="Center" >
<VerticalStackLayout Spacing="4" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom :" FontAttributes="Bold"/>
<Entry Text="{Binding Nom}" WidthRequest="170" Placeholder="Nom de l'objet ..." PlaceholderColor="LightGrey"/>
</HorizontalStackLayout>
</Frame>
<Grid>
<Frame Padding="0" IsClippedToBounds="True">
<Image x:Name="image" Source="{Binding Image}" WidthRequest="300" HeightRequest="300" Grid.Row="2" Grid.Column="1"/>
</Frame>
<Button Text="Choisir une image ..." Clicked="ButtonImage_Clicked" Grid.Row="2" VerticalOptions="End" />
</Grid>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Chapitre :" FontAttributes="Bold"/>
<Entry Text="{Binding PremierChap}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Episode :" FontAttributes="Bold"/>
<Entry Text="{Binding PremierEp}" />
</HorizontalStackLayout >
</Frame>
<Button Text="Annuler" Style="{StaticResource buttonRetirerFavInfo}" Clicked="ButtonAnnuler_Clicked" />
</VerticalStackLayout >
<VerticalStackLayout Spacing="5" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Carectiristique :" TextColor="White" FontAttributes="Bold" Grid.Row="2"/>
<Editor Text="{Binding Caracteristique}" Grid.Column="1" Grid.Row="2" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Description :" FontAttributes="Bold"/>
<Editor Text="{Binding Description}" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Button Text="Confirmer" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonConfirmer_Clicked" />
</VerticalStackLayout>
</FlexLayout>
</ScrollView>
</ContentPage>

@ -0,0 +1,58 @@
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class ModalBateau : ContentPage
{
public Manager manager => (App.Current as App).manager;
public Bateau nouveauBateau;
public string ancienNom;
public ModalBateau()
{
if (manager.SelectedItem != null)
{
nouveauBateau = manager.SelectedItem as Bateau;
ancienNom = nouveauBateau.Nom;
}
else
{
nouveauBateau = new Bateau("Bateau", " ",0,0," ", " ");
}
InitializeComponent();
BindingContext = nouveauBateau;
}
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
{
if (manager.SelectedItem != null)
{
manager.ModifierBateau(nouveauBateau, ancienNom);
nouveauBateau = manager.SelectedItem as Bateau;
}
else
{
manager.AjouterBateau(nouveauBateau);
}
await Navigation.PopModalAsync();
}
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync();
}
private async void ButtonImage_Clicked(object sender, EventArgs e)
{
var result = await FilePicker.PickAsync(new PickOptions
{
PickerTitle = "Choisissez une image ...",
FileTypes = FilePickerFileType.Images,
});
if (result != null)
{
var stream = result.FullPath;
nouveauBateau.Image = stream;
}
}
}

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.ModalBestiaire"
Title="ModalBestiaire"
BackgroundColor="#e2edf1"
Shell.PresentationMode="ModalAnimated">
<ScrollView>
<FlexLayout AlignItems="End" Wrap="Wrap" Direction="Row" JustifyContent="Center" HorizontalOptions="Center" VerticalOptions="Center" >
<VerticalStackLayout Spacing="4" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom :" FontAttributes="Bold"/>
<Entry Text="{Binding Nom}" WidthRequest="170" Placeholder="Nom de l'objet ..." PlaceholderColor="LightGrey"/>
</HorizontalStackLayout>
</Frame>
<Grid>
<Frame Padding="0" IsClippedToBounds="True">
<Image x:Name="image" Source="{Binding Image}" WidthRequest="300" HeightRequest="300" Grid.Row="2" Grid.Column="1"/>
</Frame>
<Button Text="Choisir une image ..." Clicked="ButtonImage_Clicked" Grid.Row="2" VerticalOptions="End" />
</Grid>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Origine :" FontAttributes="Bold"/>
<Entry Text="{Binding Origine}" />
</HorizontalStackLayout>
</Frame>
<Button Text="Annuler" Style="{StaticResource buttonRetirerFavInfo}" Clicked="ButtonAnnuler_Clicked" />
</VerticalStackLayout >
<VerticalStackLayout Spacing="5" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Carectiristique :" TextColor="White" FontAttributes="Bold" Grid.Row="2"/>
<Editor Text="{Binding Caracteristique}" Grid.Column="1" Grid.Row="2" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Description :" FontAttributes="Bold"/>
<Editor Text="{Binding Description}" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Button Text="Confirmer" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonConfirmer_Clicked" />
</VerticalStackLayout>
</FlexLayout>
</ScrollView>
</ContentPage>

@ -0,0 +1,58 @@
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class ModalBestiaire : ContentPage
{
public Manager manager => (App.Current as App).manager;
public Bestiaire nouveauBest;
public string ancienNom;
public ModalBestiaire()
{
if (manager.SelectedItem != null)
{
nouveauBest = manager.SelectedItem as Bestiaire;
ancienNom = nouveauBest.Nom;
}
else
{
nouveauBest = new Bestiaire("Bestiaire", " ", " ", " ");
}
InitializeComponent();
BindingContext = nouveauBest;
}
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
{
if (manager.SelectedItem != null)
{
manager.ModifierBest(nouveauBest, ancienNom);
nouveauBest = manager.SelectedItem as Bestiaire;
}
else
{
manager.AjouterBest(nouveauBest);
}
await Navigation.PopModalAsync();
}
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync();
}
private async void ButtonImage_Clicked(object sender, EventArgs e)
{
var result = await FilePicker.PickAsync(new PickOptions
{
PickerTitle = "Choisissez une image ...",
FileTypes = FilePickerFileType.Images,
});
if (result != null)
{
var stream = result.FullPath;
nouveauBest.Image = stream;
}
}
}

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.ModalEquipage"
Title="ModalEquipage"
BackgroundColor="#e2edf1"
Shell.PresentationMode="ModalAnimated">
<ScrollView>
<FlexLayout AlignItems="End" Wrap="Wrap" Direction="Row" JustifyContent="Center" HorizontalOptions="Center" VerticalOptions="Center" >
<VerticalStackLayout Spacing="4" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom :" FontAttributes="Bold"/>
<Entry Text="{Binding Nom}" WidthRequest="170" Placeholder="Nom de l'objet ..." PlaceholderColor="LightGrey"/>
</HorizontalStackLayout>
</Frame>
<Grid>
<Frame Padding="0" IsClippedToBounds="True">
<Image x:Name="image" Source="{Binding Image}" WidthRequest="300" HeightRequest="300" Grid.Row="2" Grid.Column="1"/>
</Frame>
<Button Text="Choisir une image ..." Clicked="ButtonImage_Clicked" Grid.Row="2" VerticalOptions="End" />
</Grid>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom Romanise :" FontAttributes="Bold"/>
<Entry Text="{Binding NomRomanise}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Région :" FontAttributes="Bold"/>
<Entry Text="{Binding Region}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Chapitre :" FontAttributes="Bold"/>
<Entry Text="{Binding PremierChap}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Episode :" FontAttributes="Bold"/>
<Entry Text="{Binding PremierEp}" />
</HorizontalStackLayout >
</Frame>
<Button Text="Annuler" Style="{StaticResource buttonRetirerFavInfo}" Clicked="ButtonAnnuler_Clicked" />
</VerticalStackLayout >
<VerticalStackLayout Spacing="5" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Statut :" FontAttributes="Bold"/>
<Entry Text="{Binding Statut}" />
</HorizontalStackLayout >
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Description :" FontAttributes="Bold"/>
<Editor Text="{Binding Description}" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Button Text="Confirmer" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonConfirmer_Clicked" />
</VerticalStackLayout>
</FlexLayout>
</ScrollView>
</ContentPage>

@ -0,0 +1,57 @@
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class ModalEquipage : ContentPage
{
public Manager manager => (App.Current as App).manager;
public Equipage nouvelEquipage;
public string ancienNom;
public ModalEquipage()
{
if (manager.SelectedItem != null)
{
nouvelEquipage = manager.SelectedItem as Equipage;
ancienNom = nouvelEquipage.Nom;
}
else
{
nouvelEquipage = new Equipage("Equipage", " ", " ", 0,0,true," ");
}
InitializeComponent();
BindingContext = nouvelEquipage;
}
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
{
if (manager.SelectedItem != null)
{
manager.ModifierEquipage(nouvelEquipage, ancienNom);
nouvelEquipage = manager.SelectedItem as Equipage;
}
else
{
manager.AjouterEquip(nouvelEquipage);
}
await Navigation.PopModalAsync();
}
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync();
}
private async void ButtonImage_Clicked(object sender, EventArgs e)
{
var result = await FilePicker.PickAsync(new PickOptions
{
PickerTitle = "Choisissez une image ...",
FileTypes = FilePickerFileType.Images,
});
if (result != null)
{
var stream = result.FullPath;
nouvelEquipage.Image = stream;
}
}
}

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.ModalFDD"
Title="ModalFDD"
BackgroundColor="#e2edf1"
Shell.PresentationMode="ModalAnimated">
<ScrollView>
<FlexLayout AlignItems="End" Wrap="Wrap" Direction="Row" JustifyContent="Center" HorizontalOptions="Center" VerticalOptions="Center" >
<VerticalStackLayout Spacing="4" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom :" FontAttributes="Bold"/>
<Entry Text="{Binding Nom}" WidthRequest="170" Placeholder="Nom de l'objet ..." PlaceholderColor="LightGrey"/>
</HorizontalStackLayout>
</Frame>
<Grid>
<Frame Padding="0" IsClippedToBounds="True">
<Image x:Name="image" Source="{Binding Image}" WidthRequest="300" HeightRequest="300" Grid.Row="2" Grid.Column="1"/>
</Frame>
<Button Text="Choisir une image ..." Clicked="ButtonImage_Clicked" Grid.Row="2" VerticalOptions="End" />
</Grid>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom Romanise :" FontAttributes="Bold"/>
<Entry Text="{Binding NomRomanise}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Type :" FontAttributes="Bold"/>
<Entry Text="{Binding Type}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Chapitre :" FontAttributes="Bold"/>
<Entry Text="{Binding PremierChap}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Episode :" FontAttributes="Bold"/>
<Entry Text="{Binding PremierEp}" />
</HorizontalStackLayout >
</Frame>
<Button Text="Annuler" Style="{StaticResource buttonRetirerFavInfo}" Clicked="ButtonAnnuler_Clicked" />
</VerticalStackLayout >
<VerticalStackLayout Spacing="5" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Description :" FontAttributes="Bold"/>
<Editor Text="{Binding Description}" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Forces :" FontAttributes="Bold"/>
<Editor Text="{Binding Forces}" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Faiblesses :" FontAttributes="Bold" />
<Editor Text="{Binding Faiblesses}" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Button Text="Confirmer" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonConfirmer_Clicked" />
</VerticalStackLayout>
</FlexLayout>
</ScrollView>
</ContentPage>

@ -0,0 +1,57 @@
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class ModalFDD : ContentPage
{
public Manager manager => (App.Current as App).manager;
public FruitDuDemon nouveauFdd;
public string ancienNom;
public ModalFDD()
{
if (manager.SelectedItem != null)
{
nouveauFdd = manager.SelectedItem as FruitDuDemon;
ancienNom = nouveauFdd.Nom;
}
else
{
nouveauFdd = new FruitDuDemon("Fruit", " ", " ",0,0, " "," ","");
}
InitializeComponent();
BindingContext = nouveauFdd;
}
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
{
if (manager.SelectedItem != null)
{
manager.ModifierFDD(nouveauFdd, ancienNom);
nouveauFdd = manager.SelectedItem as FruitDuDemon;
}
else
{
manager.AjouterFDD(nouveauFdd);
}
await Navigation.PopModalAsync();
}
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync();
}
private async void ButtonImage_Clicked(object sender, EventArgs e)
{
var result = await FilePicker.PickAsync(new PickOptions
{
PickerTitle = "Choisissez une image ...",
FileTypes = FilePickerFileType.Images,
});
if (result != null)
{
var stream = result.FullPath;
nouveauFdd.Image = stream;
}
}
}

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.ModalIle"
Title="ModalIle"
BackgroundColor="#e2edf1"
Shell.PresentationMode="ModalAnimated">
<ScrollView>
<FlexLayout AlignItems="End" Wrap="Wrap" Direction="Row" JustifyContent="Center" HorizontalOptions="Center" VerticalOptions="Center" >
<VerticalStackLayout Spacing="4" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom :" FontAttributes="Bold"/>
<Entry Text="{Binding Nom}" WidthRequest="170" Placeholder="Nom de l'objet ..." PlaceholderColor="LightGrey"/>
</HorizontalStackLayout>
</Frame>
<Grid>
<Frame Padding="0" IsClippedToBounds="True">
<Image x:Name="image" Source="{Binding Image}" WidthRequest="300" HeightRequest="300" Grid.Row="2" Grid.Column="1"/>
</Frame>
<Button Text="Choisir une image ..." Clicked="ButtonImage_Clicked" Grid.Row="2" VerticalOptions="End" />
</Grid>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom Romanise :" FontAttributes="Bold"/>
<Entry Text="{Binding NomRomanise}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Region :" FontAttributes="Bold"/>
<Entry Text="{Binding Region}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Chapitre :" FontAttributes="Bold"/>
<Entry Text="{Binding PremierChap}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Episode :" FontAttributes="Bold"/>
<Entry Text="{Binding PremierEp}" />
</HorizontalStackLayout >
</Frame>
<Button Text="Annuler" Style="{StaticResource buttonRetirerFavInfo}" Clicked="ButtonAnnuler_Clicked" />
</VerticalStackLayout >
<VerticalStackLayout Spacing="5" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Description :" FontAttributes="Bold"/>
<Editor Text="{Binding Description}" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Geographie :" FontAttributes="Bold"/>
<Editor Text="{Binding Geographie}" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Button Text="Confirmer" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonConfirmer_Clicked" />
</VerticalStackLayout>
</FlexLayout>
</ScrollView>
</ContentPage>

@ -0,0 +1,59 @@
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class ModalIle : ContentPage
{
public Manager manager => (App.Current as App).manager;
public Ile nouvelIle;
public string ancienNom;
public ModalIle()
{
if(manager.SelectedItem != null)
{
nouvelIle=(Ile)manager.SelectedItem;
ancienNom = manager.SelectedItem.Nom;
}
else
{
this.nouvelIle = new Ile("Ile", "", "", 0, 0, "", "");
}
InitializeComponent();
BindingContext = nouvelIle;
}
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
{
if (manager.SelectedItem != null)
{
manager.ModifierIle(nouvelIle,ancienNom);
manager.SelectedItem=nouvelIle;
}
else
{
manager.AjouterIle(nouvelIle);
}
await Navigation.PopModalAsync();
}
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync();
}
private async void ButtonImage_Clicked(object sender, EventArgs e)
{
var result = await FilePicker.PickAsync(new PickOptions
{
PickerTitle = "Choisissez une image ...",
FileTypes = FilePickerFileType.Images,
});
if (result != null)
{
var stream = result.FullPath;
nouvelIle.Image = stream;
}
}
}

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.ModalPersonnage"
Title="ModalPersonnage"
BackgroundColor="#e2edf1">
<ScrollView>
<FlexLayout AlignItems="End" Wrap="Wrap" Direction="Row" JustifyContent="Center" HorizontalOptions="Center" VerticalOptions="Center" >
<VerticalStackLayout Spacing="4" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom :" FontAttributes="Bold"/>
<Entry Text="{Binding Nom}" WidthRequest="170" Placeholder="Nom de l'objet ..." PlaceholderColor="LightGrey"/>
</HorizontalStackLayout>
</Frame>
<Grid>
<Frame Padding="0" IsClippedToBounds="True">
<Image x:Name="image" Source="{Binding Image}" WidthRequest="300" HeightRequest="300" Grid.Row="2" Grid.Column="1"/>
</Frame>
<Button Text="Choisir une image ..." Clicked="ButtonImage_Clicked" Grid.Row="2" VerticalOptions="End" />
</Grid>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom Romanise :" FontAttributes="Bold"/>
<Entry Text="{Binding NomRomanise}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Prime :" FontAttributes="Bold"/>
<Entry Text="{Binding Prime}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Epithete :" FontAttributes="Bold"/>
<Entry Text="{Binding Epithete}" />
</HorizontalStackLayout>
</Frame>
<Button Text="Annuler" Style="{StaticResource buttonRetirerFavInfo}" Clicked="ButtonAnnuler_Clicked" />
</VerticalStackLayout >
<VerticalStackLayout Spacing="5" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Origine :" FontAttributes="Bold"/>
<Entry Text="{Binding Origine}" />
</HorizontalStackLayout >
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Description :" FontAttributes="Bold"/>
<Editor Text="{Binding Description}" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Geographie :" FontAttributes="Bold"/>
<Editor Text="{Binding Geographie}" WidthRequest="300" HeightRequest="150"/>
</HorizontalStackLayout>
</Frame>
<Button Text="Confirmer" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonConfirmer_Clicked" />
</VerticalStackLayout>
</FlexLayout>
</ScrollView>
</ContentPage>

@ -0,0 +1,38 @@
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class ModalPersonnage : ContentPage
{
public Manager manager => (App.Current as App).manager;
public Personnage nouveauPerso = new Personnage("Personnage", 0, "", 0, 0, "", "", "");
public ModalPersonnage()
{
InitializeComponent();
BindingContext = nouveauPerso;
}
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
{
manager.AjouterPerso(nouveauPerso);
await Navigation.PopModalAsync();
}
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync();
}
private async void ButtonImage_Clicked(object sender, EventArgs e)
{
var result = await FilePicker.PickAsync(new PickOptions
{
PickerTitle = "Choisissez une image ...",
FileTypes = FilePickerFileType.Images,
});
if (result != null)
{
var stream = result.FullPath;
nouveauPerso.Image = stream;
}
}
}

@ -48,6 +48,10 @@
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup>
<None Remove="Resources\Fonts\microns.ttf" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="Plugin.Maui.Audio" Version="1.0.0" />
@ -58,6 +62,24 @@
</ItemGroup>
<ItemGroup>
<Compile Update="ModalFDD.xaml.cs">
<DependentUpon>ModalFDD.xaml</DependentUpon>
</Compile>
<Compile Update="ModalBestiaire.xaml.cs">
<DependentUpon>ModalBestiaire.xaml</DependentUpon>
</Compile>
<Compile Update="ModalPersonnage.xaml.cs">
<DependentUpon>ModalPersonnage.xaml</DependentUpon>
</Compile>
<Compile Update="ModalIle.xaml.cs">
<DependentUpon>ModalIle.xaml</DependentUpon>
</Compile>
<Compile Update="ModalEquipage.xaml.cs">
<DependentUpon>ModalEquipage.xaml</DependentUpon>
</Compile>
<Compile Update="ModalBateau.xaml.cs">
<DependentUpon>ModalBateau.xaml</DependentUpon>
</Compile>
<Compile Update="PageFavoris.xaml.cs">
<DependentUpon>PageFavoris.xaml</DependentUpon>
</Compile>
@ -88,6 +110,24 @@
</ItemGroup>
<ItemGroup>
<MauiXaml Update="ModalFDD.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ModalBestiaire.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ModalPersonnage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ModalIle.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ModalEquipage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ModalBateau.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="PageFavoris.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>

@ -3,20 +3,25 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageBateau"
Title="PageBateau"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<VerticalStackLayout Spacing="40">
<Grid ColumnDefinitions="200,*,100,10,100" BackgroundColor="#72a3b3" Padding="10">
<Grid ColumnDefinitions="200,*,150,20,150,20,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="2">
<Label Text="Filtrer" HorizontalTextAlignment="Center" />
</Frame>
<Button Text="Ajouter" Clicked="Button_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="2"/>
<Picker Title="Filtrer" Grid.Column="4" ItemsSource="{Binding Equipages}" ItemDisplayBinding="{Binding Nom}" SelectedIndexChanged="PickerFiltre_SelectedIndexChanged" Style="{StaticResource pickerOhara}"/>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="4">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
<Picker Title="Trier" Grid.Column="6" Style="{StaticResource pickerOhara}">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Nom croissant</x:String>
<x:String>Nom décroissant</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</Grid>
<ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always">
<CollectionView x:Name="listeBateau" ItemsSource="{Binding Bateaux}" ItemsLayout="HorizontalList" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listeBateau_SelectionChanged" >

@ -13,17 +13,39 @@ public partial class PageBateau : ContentPage
{
InitializeComponent();
BindingContext = manager;
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
listeBateau.ItemsSource = manager.RechercheObjetOhara(searchBar.Text, new List<ObjetOhara>(manager.Bateaux.ToList()));
}
searchBar.TextChanged += OnTextChanged;
}
async void listeBateau_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem = (Bateau)listeBateau.SelectedItem;
await Navigation.PushAsync(new PageInfoBateau());
await Shell.Current.GoToAsync(nameof(PageInfoBateau));
}
private void Button_Clicked(object sender, EventArgs e)
private async void Button_Clicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync(nameof(ModalBateau));
}
private void PickerFiltre_SelectedIndexChanged(object sender, EventArgs e)
{
var picker = (Picker)sender;
int selectedIndex = picker.SelectedIndex;
if (selectedIndex != -1)
{
listeBateau.ItemsSource = manager.FiltrerBateau(((Equipage)picker.ItemsSource[selectedIndex]).Nom);
}
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
manager.SelectedItem = null;
listeBateau.SelectedItem = null;
}
}

@ -3,55 +3,62 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageBestiaire"
Title="PageBestiaire"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<VerticalStackLayout Spacing="20">
<CollectionView x:Name="listeBest" ItemsSource="{Binding Bestiaire}" ItemsLayout="VerticalGrid, 4" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listeBest_SelectionChanged">
<CollectionView.Header>
<Grid ColumnDefinitions="200,*,100,10,100" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="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="4">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
</Grid>
</CollectionView.Header>
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="20" ColumnSpacing="20" RowSpacing="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="25*"/>
</Grid.ColumnDefinitions>
<Frame Style="{StaticResource frameObjet}">
<ScrollView>
<VerticalStackLayout>
<Grid ColumnDefinitions="200,*,150,20,150,20,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." Style="{StaticResource searchBarOhara}" Grid.Column="0"/>
<Button Text="Ajouter" Clicked="ButtonAjouter_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="2"/>
<!--<Picker Title="Filtrer" Grid.Column="4" SelectedIndexChanged="PickerFiltre_SelectedIndexChanged" Style="{StaticResource pickerOhara}" >
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Aucun</x:String>
<x:String>Logia</x:String>
<x:String>Paramecia</x:String>
<x:String>Zoan Carnivore</x:String>
<x:String>Zoan Mythique</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>-->
<Picker Title="Trier" Grid.Column="6" Style="{StaticResource pickerOhara}">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Nom croissant</x:String>
<x:String>Nom décroissant</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</Grid>
<FlexLayout x:Name="listeBest" AlignItems="Center" Wrap="Wrap"
HorizontalOptions="Center"
BindableLayout.ItemsSource="{Binding Bestiaire}" JustifyContent="SpaceEvenly">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameObjet}" Margin="0,10,0,0" >
<Frame.GestureRecognizers>
<TapGestureRecognizer CommandParameter="{Binding Nom}" Tapped="TapGestureRecognizer_Tapped"/>
</Frame.GestureRecognizers>
<StackLayout Orientation="Vertical" Padding="5">
<Image
Source="{Binding Image}"
HeightRequest="290"
WidthRequest="290" />
HeightRequest="280"
WidthRequest="280" />
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
Text="{Binding Nom}"
FontSize="19"
TextColor="#72a3b3"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</BindableLayout.ItemTemplate>
</FlexLayout>
</VerticalStackLayout>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -14,11 +14,30 @@ public partial class PageBestiaire : ContentPage
{
InitializeComponent();
BindingContext = manager;
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
BindableLayout.SetItemsSource(listeBest, manager.RechercheObjetOhara(searchBar.Text, new List<ObjetOhara>(manager.Bestiaire.ToList())));
}
searchBar.TextChanged += OnTextChanged;
}
private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
{
Bestiaire SelectedItem = manager.Bestiaire.FirstOrDefault(p => p.Nom == (((TappedEventArgs)e).Parameter.ToString()));
if (SelectedItem != null)
{
//do something you want
manager.SelectedItem = SelectedItem;
await Navigation.PushAsync(new PageInfoBestiaire());
}
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
BindableLayout.SetItemsSource(listeBest, manager.Bestiaire);
}
async void listeBest_SelectionChanged(object sender, SelectionChangedEventArgs e)
private async void ButtonAjouter_Clicked(object sender, EventArgs e)
{
manager.SelectedItem = (Bestiaire)listeBest.SelectedItem;
await Navigation.PushAsync(new PageInfoBestiaire());
await Navigation.PushModalAsync(new ModalBestiaire());
}
}

@ -1,51 +1,51 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageEquipage"
Title="PageEquipage"
BackgroundColor="#e2edf1">
<CollectionView x:Name="listeEquip" ItemsSource="{Binding Equipages}" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listeEquip_SelectionChanged">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical" Span="4" HorizontalItemSpacing="15" VerticalItemSpacing="15"/>
</CollectionView.ItemsLayout>
<CollectionView.Header>
<Grid ColumnDefinitions="200,*,100,100,10,100" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="3">
<Label Text="Filtrer" HorizontalTextAlignment="Center" />
</Frame>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="5">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
</Grid>
</CollectionView.Header>
<CollectionView.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameEquip}" >
<StackLayout Orientation="Vertical" Padding="5">
<Image Source="{Binding Image}"
HeightRequest="290"
WidthRequest="290"/>
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="19"
TextColor="White"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageEquipage"
Title="PageEquipage"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<ScrollView>
<VerticalStackLayout>
<Grid ColumnDefinitions="200,*,150,20,150,20,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." Style="{StaticResource searchBarOhara}" Grid.Column="0"/>
<Button Text="Ajouter" Clicked="ButtonAjouter_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="2"/>
<Picker Title="Trier" Grid.Column="6" Style="{StaticResource pickerOhara}">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Nom croissant</x:String>
<x:String>Nom décroissant</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</Grid>
<FlexLayout x:Name="listEquip" AlignItems="Center" Wrap="Wrap"
HorizontalOptions="Center" JustifyContent="SpaceEvenly">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameEquip}" Margin="0,10,0,0" >
<Frame.GestureRecognizers>
<TapGestureRecognizer CommandParameter="{Binding Nom}" Tapped="TapGestureRecognizer_Tapped"/>
</Frame.GestureRecognizers>
<StackLayout Orientation="Vertical" Padding="5">
<Image
Source="{Binding Image}"
HeightRequest="280"
WidthRequest="280" />
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="19"
TextColor="White"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</BindableLayout.ItemTemplate>
</FlexLayout>
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -10,14 +10,32 @@ public partial class PageEquipage : ContentPage
public PageEquipage()
{
InitializeComponent();
BindingContext = manager;
BindableLayout.SetItemsSource(listEquip, manager.Equipages);
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
BindableLayout.SetItemsSource(listEquip,manager.RechercheObjetOhara(searchBar.Text,new List<ObjetOhara>(manager.Equipages.ToList())));
}
searchBar.TextChanged += OnTextChanged;
}
async void listeEquip_SelectionChanged(object sender, SelectionChangedEventArgs e)
private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
{
manager.SelectedItem=(Equipage)listeEquip.SelectedItem;
await Navigation.PushAsync(new PageInfoEquipage());
}
Equipage SelectedItem = manager.Equipages.FirstOrDefault(p => p.Nom == (((TappedEventArgs)e).Parameter.ToString()));
if (SelectedItem != null)
{
manager.SelectedItem = SelectedItem;
await Shell.Current.GoToAsync(nameof(PageInfoEquipage));
}
}
private async void ButtonAjouter_Clicked(object sender, EventArgs e)
{
manager.SelectedItem = null;
await Shell.Current.GoToAsync(nameof(ModalEquipage));
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
BindableLayout.SetItemsSource(listEquip, manager.Equipages);
}
}

@ -3,22 +3,25 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageFDD"
Title="PageFDD"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<CollectionView x:Name="listeFDD" ItemsSource="{Binding Fruits}" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listeFDD_SelectionChanged" >
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical" Span="4" HorizontalItemSpacing="15" VerticalItemSpacing="15"/>
</CollectionView.ItemsLayout>
<CollectionView.Header>
<Grid ColumnDefinitions="200,*,150,10,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Frame x:Name="Logia" CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="2">
<Label Text="Filtrer" HorizontalTextAlignment="Center" />
</Frame>
<Picker Title="Trier" Grid.Column="4" BackgroundColor="#bfe5ef">
<ScrollView>
<VerticalStackLayout>
<Grid ColumnDefinitions="200,*,150,20,150,20,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." Style="{StaticResource searchBarOhara}" Grid.Column="0"/>
<Button Text="Ajouter" Clicked="Button_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="2"/>
<Picker Title="Filtrer" Grid.Column="4" SelectedIndexChanged="PickerFiltre_SelectedIndexChanged" Style="{StaticResource pickerOhara}" >
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Aucun</x:String>
<x:String>Logia</x:String>
<x:String>Paramecia</x:String>
<x:String>Zoan Carnivore</x:String>
<x:String>Zoan Mythique</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
<Picker Title="Trier" Grid.Column="6" Style="{StaticResource pickerOhara}">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Nom croissant</x:String>
@ -26,39 +29,41 @@
</x:Array>
</Picker.ItemsSource>
</Picker>
</Grid>
</CollectionView.Header>
<CollectionView.ItemTemplate >
<DataTemplate >
<Frame Style="{StaticResource frameObjet}">
<StackLayout Orientation="Vertical" Padding="5">
<Image
Source="{Binding Image}"
HeightRequest="280"
WidthRequest="280" />
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="19"
TextColor="#72a3b3"
FontAttributes="Bold" />
<Label
VerticalOptions="Center"
HorizontalOptions="Center"
Text="{Binding Type}"
FontAttributes="Italic"
TextColor="#72a3b3"/>
</StackLayout>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<FlexLayout x:Name="listeFDD" AlignItems="Center" Wrap="Wrap"
HorizontalOptions="Center"
BindableLayout.ItemsSource="{Binding Fruits}" JustifyContent="SpaceEvenly">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameObjet}" Margin="0,10,0,0" >
<Frame.GestureRecognizers>
<TapGestureRecognizer CommandParameter="{Binding Nom}" Tapped="TapGestureRecognizer_Tapped"/>
</Frame.GestureRecognizers>
<StackLayout Orientation="Vertical" Padding="5">
<Image
Source="{Binding Image}"
HeightRequest="280"
WidthRequest="280" />
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="19"
TextColor="#72a3b3"
FontAttributes="Bold" />
<Label
VerticalOptions="Center"
HorizontalOptions="Center"
Text="{Binding Type}"
FontAttributes="Italic"
TextColor="#72a3b3"/>
</StackLayout>
</Frame>
</DataTemplate>
</BindableLayout.ItemTemplate>
</FlexLayout>
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -5,47 +5,63 @@ using Model.Classes;
using Model.Managers;
using Model.Stub;
using Plugin.Maui.Audio;
using System.Collections.ObjectModel;
using System.Windows.Input;
public partial class PageFDD : ContentPage
{
public ICommand FiltrerType { get; private set; }
public Manager manager => (App.Current as App).manager;
public PageFDD()
{
{
InitializeComponent();
BindingContext = manager;
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
listeFDD.ItemsSource = manager.RechercheFDD(searchBar.Text,manager.Fruits.ToList());
BindableLayout.SetItemsSource(listeFDD, manager.RechercheObjetOhara(searchBar.Text, new List<ObjetOhara>(manager.Fruits.ToList())));
}
searchBar.TextChanged += OnTextChanged;
FiltrerType = new Command((type) => listeFDD.ItemsSource = manager.FiltrerFDD(type.ToString()));
//Logia.Command = FiltrerType;
//Logia.CommandParameter = "Logia";
searchBar.TextChanged += OnTextChanged;
}
private void listeFDD_ScrollToRequested(object sender, ScrollToRequestEventArgs e)
private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
{
FruitDuDemon SelectedItem = manager.Fruits.FirstOrDefault(p => p.Nom == (((TappedEventArgs)e).Parameter.ToString()));
if (SelectedItem != null)
{
//do something you want
manager.SelectedItem = SelectedItem;
await Shell.Current.GoToAsync(nameof(PageInfoFdd));
}
}
private void MenuFlyoutItem_Clicked(object sender, EventArgs e)
private async void Button_Clicked(object sender, EventArgs e)
{
manager.SelectedItem = null;
await Shell.Current.GoToAsync(nameof(ModalFDD));
}
private void Label_Focused(object sender, FocusEventArgs e)
private void PickerFiltre_SelectedIndexChanged(object sender, EventArgs e)
{
var picker = (Picker)sender;
int selectedIndex = picker.SelectedIndex;
if (selectedIndex == 0)
{
BindableLayout.SetItemsSource(listeFDD, manager.Fruits.ToList());
}
else
{
BindableLayout.SetItemsSource(listeFDD, manager.FiltrerFDD((string)picker.ItemsSource[selectedIndex]).ToList());
}
}
async void listeFDD_SelectionChanged(object sender, SelectionChangedEventArgs e)
private void ContentPage_Appearing(object sender, EventArgs e)
{
manager.SelectedItem=(FruitDuDemon)listeFDD.SelectedItem;
await Navigation.PushAsync(new PageInfoFdd());
BindableLayout.SetItemsSource(listeFDD, manager.Fruits.ToList());
}
}

@ -3,54 +3,61 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageFavoris"
Title="PageFavoris"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<CollectionView x:Name="listeFavs" SelectionMode="Single" SelectionChanged="listeFavs_SelectionChanged" EmptyView="Aucun résultat trouvé.">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical" Span="4" HorizontalItemSpacing="15" VerticalItemSpacing="15"/>
</CollectionView.ItemsLayout>
<CollectionView.Header>
<Grid ColumnDefinitions="200,*,100,100,10,100" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Button Text="Actualiser" Clicked="Button_Clicked" Grid.Column="2" CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef"/>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="3">
<Label Text="Filtrer" HorizontalTextAlignment="Center" />
</Frame>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="5">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
<ScrollView>
<VerticalStackLayout>
<Grid ColumnDefinitions="200,*,150,20,150,20,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." Style="{StaticResource searchBarOhara}" Grid.Column="0"/>
<!--<Button Text="Ajouter" Clicked="Button_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="2"/>
<Picker Title="Filtrer" Grid.Column="4" SelectedIndexChanged="PickerFiltre_SelectedIndexChanged" Style="{StaticResource pickerOhara}" >
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Aucun</x:String>
<x:String>Logia</x:String>
<x:String>Paramecia</x:String>
<x:String>Zoan Carnivore</x:String>
<x:String>Zoan Mythique</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>-->
<Picker Title="Trier" Grid.Column="6" Style="{StaticResource pickerOhara}">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Nom croissant</x:String>
<x:String>Nom décroissant</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</Grid>
</CollectionView.Header>
<CollectionView.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameObjet}">
<StackLayout Orientation="Vertical" Padding="5">
<Image
Source="{Binding Image}"
HeightRequest="290"
WidthRequest="290" />
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="19"
TextColor="#72a3b3"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<FlexLayout x:Name="listeFav" AlignItems="Center" Wrap="Wrap"
HorizontalOptions="Center" JustifyContent="SpaceEvenly">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameObjet}" Margin="0,10,0,0" >
<Frame.GestureRecognizers>
<TapGestureRecognizer CommandParameter="{Binding Nom}" Tapped="TapGestureRecognizer_Tapped"/>
</Frame.GestureRecognizers>
<StackLayout Orientation="Vertical" Padding="5">
<Image
Source="{Binding Image}"
HeightRequest="280"
WidthRequest="280" />
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="19"
TextColor="#72a3b3"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</BindableLayout.ItemTemplate>
</FlexLayout>
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -11,64 +11,71 @@ public partial class PageFavoris : ContentPage
public PageFavoris()
{
InitializeComponent();
listeFavs.ItemsSource = manager.GetFavoris();
BindableLayout.SetItemsSource(listeFav, manager.GetFavoris());
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
listeFavs.ItemsSource = manager.RechercheObjetOhara(searchBar.Text, manager.GetFavoris());
BindableLayout.SetItemsSource(listeFav, manager.RechercheObjetOhara(searchBar.Text, manager.GetFavoris()));
}
searchBar.TextChanged += OnTextChanged;
}
void listeFavs_SelectionChanged(object sender, SelectionChangedEventArgs e)
private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
{
Type t = listeFavs.SelectedItem.GetType();
Console.WriteLine(t);
if (t.Equals(typeof(Bateau)))
{
manager.SelectedItem = (Bateau)listeFavs.SelectedItem;
Navigation.PushAsync(new PageInfoBateau());
}
else if (t.Equals(typeof(Equipage)))
{
manager.SelectedItem = (Equipage)listeFavs.SelectedItem;
Navigation.PushAsync(new PageInfoEquipage());
}
else if (t.Equals(typeof(Personnage)))
{
manager.SelectedItem = (Personnage)listeFavs.SelectedItem;
Navigation.PushAsync(new PageInfoPersonnage());
}
else if (t.Equals(typeof(Ile)))
ObjetOhara SelectedItem = manager.GetFavoris().FirstOrDefault(p => p.Nom == (((TappedEventArgs)e).Parameter.ToString()));
if (SelectedItem != null)
{
manager.SelectedItem=(Ile)listeFavs.SelectedItem;
Navigation.PushAsync(new PageInfoIle());
manager.SelectedItem = SelectedItem;
Type t = manager.SelectedItem.GetType();
if (t.Equals(typeof(Bateau)))
{
await Shell.Current.GoToAsync(nameof(PageInfoBateau));
}
else if (t.Equals(typeof(Equipage)))
{
await Shell.Current.GoToAsync(nameof(PageInfoEquipage));
}
else if (t.Equals(typeof(Personnage)))
{
await Shell.Current.GoToAsync(nameof(PageInfoPersonnage));
}
else if (t.Equals(typeof(Ile)))
{
await Shell.Current.GoToAsync(nameof(PageInfoIle));
}
else if (t.Equals(typeof(FruitDuDemon)))
{
await Shell.Current.GoToAsync(nameof(PageInfoFdd));
}
else if (t.Equals(typeof(Bestiaire)))
{
await Shell.Current.GoToAsync(nameof(PageInfoBestiaire));
}
}
else if (t.Equals(typeof(FruitDuDemon)))
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
BindableLayout.SetItemsSource(listeFav, manager.GetFavoris());
}
private void PickerFiltre_SelectedIndexChanged(object sender, EventArgs e)
{
var picker = (Picker)sender;
int selectedIndex = picker.SelectedIndex;
if (selectedIndex == 0)
{
manager.SelectedItem = (FruitDuDemon)listeFavs.SelectedItem;
Navigation.PushAsync(new PageInfoFdd());
BindableLayout.SetItemsSource(listeFav, manager.GetFavoris());
}
else if (t.Equals(typeof(Bestiaire)))
else
{
manager.SelectedItem = (Bestiaire)listeFavs.SelectedItem;
Navigation.PushAsync(new PageInfoBestiaire());
// listeFavs.ItemsSource = manager.FiltrerFDD((string)picker.ItemsSource[selectedIndex]).ToList();
}
}
private void Button_Clicked(object sender, EventArgs e)
{
listeFavs.ItemsSource = manager.GetFavoris();
}
}

@ -3,22 +3,35 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageIle"
Title="PageIle"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<VerticalStackLayout Spacing="40">
<Grid ColumnDefinitions="200,*,100,10,100" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="2">
<Label Text="Filtrer" HorizontalTextAlignment="Center" />
</Frame>
<VerticalStackLayout BackgroundColor="#bfe5ef" Grid.Column="4">
<Button Text="Trier"/>
<Button Text="Nom croissant" IsVisible="False"/>
<Button Text="Nom décroissant" IsVisible="False"/>
</VerticalStackLayout>
<Grid ColumnDefinitions="200,*,150,20,150,20,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." Style="{StaticResource searchBarOhara}" Grid.Column="0"/>
<Button Text="Ajouter" Clicked="Button_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="2"/>
<Picker Title="Filtrer" Grid.Column="4" SelectedIndexChanged="PickerFiltre_SelectedIndexChanged" Style="{StaticResource pickerOhara}" >
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Aucun</x:String>
<x:String>East Blue</x:String>
<x:String>West Blue</x:String>
<x:String>North Blue</x:String>
<x:String>South Blue</x:String>
<x:String>Grand Line</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
<Picker Title="Trier" Grid.Column="6" Style="{StaticResource pickerOhara}">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Nom croissant</x:String>
<x:String>Nom décroissant</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</Grid>
<ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always">

@ -13,12 +13,43 @@ public partial class PageIle : ContentPage
{
InitializeComponent();
BindingContext = manager;
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
listeIle.ItemsSource = manager.RechercheObjetOhara(searchBar.Text, new List<ObjetOhara>(manager.Iles.ToList()));
}
searchBar.TextChanged += OnTextChanged;
}
async void listeIle_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem=(Ile)listeIle.SelectedItem;
await Navigation.PushAsync(new PageInfoIle());
await Shell.Current.GoToAsync(nameof(PageInfoIle));
}
private async void Button_Clicked(object sender, EventArgs e)
{
manager.SelectedItem = null;
await Shell.Current.GoToAsync(nameof(ModalIle));
}
private void PickerFiltre_SelectedIndexChanged(object sender, EventArgs e)
{
var picker = (Picker)sender;
int selectedIndex = picker.SelectedIndex;
if (selectedIndex == 0)
{
listeIle.ItemsSource =manager.Iles.ToList();
}
else
{
listeIle.ItemsSource = manager.FiltrerIle((string)picker.ItemsSource[selectedIndex]);
}
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
manager.SelectedItem = null;
listeIle.SelectedItem = null;
}
}

@ -29,7 +29,10 @@
<Frame Style="{StaticResource frameInfo}">
<Label Text="{Binding EstFavori}" TextColor="#72a3b3"/>
</Frame>
<FlexLayout AlignItems="Start" Wrap="Wrap" Direction="Row" JustifyContent="SpaceEvenly" >
<Button Text="Supprimer" Style="{StaticResource buttonRetirerFavInfo}" Clicked="Supprimer_Clicked" FlexLayout.Basis="49.5%"/>
<Button Text="Modifier" Style="{StaticResource buttonFavsInfo}" Clicked="Modifier_Clicked" FlexLayout.Basis="49.5%"/>
</FlexLayout>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">
@ -48,12 +51,8 @@
<Label Text="{Binding NomRomanise}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Affiliation(s) :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Affiliation}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Button x:Name="bouttonAffiliation" Text="{Binding Affiliation.Nom, StringFormat='Affiliation : {0}'}" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonAffiliation_Clicked" ToolTipProperties.Text="Clickez pour en savoir plus..."/>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Première apparition manga :" TextColor="#72a3b3" FontAttributes="Bold"/>
@ -74,7 +73,6 @@
<Label Text="Caracteristiques :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Caracteristique}" TextColor="#72a3b3" />
</VerticalStackLayout>
</ScrollView>

@ -12,20 +12,22 @@ public partial class PageInfoBateau : ContentPage
public PageInfoBateau()
{
InitializeComponent();
if(manager.SelectedItem.EstFavori==true)
if(manager.SelectedItem?.EstFavori==true)
{
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
}
BindingContext=manager.SelectedItem;
if(((Bateau)manager.SelectedItem).Affiliation==null)
bouttonAffiliation.IsVisible=false;
BindingContext =manager.SelectedItem;
}
private void AjouterFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem,true);
manager.ModifierFavBateau((Bateau)manager.SelectedItem,true);
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
@ -33,9 +35,27 @@ public partial class PageInfoBateau : ContentPage
private void RetirerFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, false);
manager.ModifierFavBateau((Bateau)manager.SelectedItem, false);
bouttonFav.IsEnabled = true;
bouttonFav.Text = "Ajouter au favoris";
retirerFav.IsVisible = false;
}
private async void ButtonAffiliation_Clicked(object sender, EventArgs e)
{
Bateau bateau = (Bateau)manager.SelectedItem;
manager.SelectedItem = bateau.Affiliation;
await Navigation.PushAsync(new PageInfoEquipage());
}
private async void Supprimer_Clicked(object sender, EventArgs e)
{
manager.SupprimerBateau((Bateau)manager.SelectedItem);
await Navigation.PopAsync();
}
private async void Modifier_Clicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync(nameof(ModalBateau), true);
}
}

@ -26,7 +26,10 @@
<Frame Style="{StaticResource frameInfo}">
<Label Text="2 - Caracteristiques" TextColor="#72a3b3"/>
</Frame>
<FlexLayout AlignItems="Start" Wrap="Wrap" Direction="Row" JustifyContent="SpaceEvenly" >
<Button Text="Supprimer" Style="{StaticResource buttonRetirerFavInfo}" Clicked="Supprimer_Clicked" FlexLayout.Basis="49.5%"/>
<Button Text="Modifier" Style="{StaticResource buttonFavsInfo}" Clicked="Modifier_Clicked" FlexLayout.Basis="49.5%"/>
</FlexLayout>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">

@ -9,7 +9,7 @@ public partial class PageInfoBestiaire : ContentPage
public PageInfoBestiaire()
{
InitializeComponent();
if (manager.SelectedItem.EstFavori == true)
if (manager.SelectedItem?.EstFavori == true)
{
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
@ -22,7 +22,7 @@ public partial class PageInfoBestiaire : ContentPage
private void AjouterFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, true);
manager.ModifierFavBest((Bestiaire)manager.SelectedItem, true);
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
@ -30,9 +30,18 @@ public partial class PageInfoBestiaire : ContentPage
private void RetirerFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, false);
manager.ModifierFavBest((Bestiaire)manager.SelectedItem, false);
bouttonFav.IsEnabled = true;
bouttonFav.Text = "Ajouter au favoris";
retirerFav.IsVisible = false;
}
private async void Supprimer_Clicked(object sender, EventArgs e)
{
manager.SupprimerBest((Bestiaire)manager.SelectedItem);
await Navigation.PopAsync();
}
private async void Modifier_Clicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync(nameof(ModalBestiaire), true);
}
}

@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageInfoEquipage"
Title="PageInfoEquipage"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<ScrollView Orientation="Vertical" VerticalScrollBarVisibility="Always">
@ -30,6 +31,10 @@
<Frame Style="{StaticResource frameInfo}">
<Label Text="3 - Allié(s)" TextColor="#72a3b3"/>
</Frame>
<FlexLayout AlignItems="Start" Wrap="Wrap" Direction="Row" JustifyContent="SpaceEvenly" >
<Button Text="Supprimer" Style="{StaticResource buttonRetirerFavInfo}" Clicked="Supprimer_Clicked" FlexLayout.Basis="49.5%"/>
<Button Text="Modifier" Style="{StaticResource buttonFavsInfo}" Clicked="Modifier_Clicked" FlexLayout.Basis="49.5%"/>
</FlexLayout>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">
@ -72,10 +77,58 @@
<Label Text="{Binding Description}" TextColor="#72a3b3" />
<Label Text="Membre(s) :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Membre}" TextColor="#72a3b3" />
<CollectionView x:Name="listMembre" ItemsLayout="HorizontalList" ItemsSource="{Binding Membre}" SelectionMode="Single" SelectionChanged="listMembre_SelectionChanged" >
<CollectionView.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameObjet}" Margin="5">
<StackLayout Orientation="Vertical">
<Image Source="{Binding Image}"
HeightRequest="175"
WidthRequest="175"/>
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="15"
TextColor="#72a3b3"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<Label Text="Allié(s) :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Allie}" TextColor="#72a3b3" />
<CollectionView x:Name="listAlle" ItemsLayout="HorizontalList" ItemsSource="{Binding Allie}" SelectionMode="Single" SelectionChanged="listAlle_SelectionChanged" >
<CollectionView.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameEquip}" >
<StackLayout Orientation="Vertical">
<Image Source="{Binding Image}"
HeightRequest="175"
WidthRequest="175"/>
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="15"
TextColor="White"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -1,6 +1,8 @@
using Model.Stub;
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class PageInfoEquipage : ContentPage
@ -9,7 +11,7 @@ public partial class PageInfoEquipage : ContentPage
public PageInfoEquipage()
{
InitializeComponent();
if (manager.SelectedItem.EstFavori == true)
if (manager.SelectedItem?.EstFavori == true)
{
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
@ -22,7 +24,7 @@ public partial class PageInfoEquipage : ContentPage
private void AjouterFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, true);
manager.ModifierFavEquip((Equipage)manager.SelectedItem, true);
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
@ -30,9 +32,40 @@ public partial class PageInfoEquipage : ContentPage
private void RetirerFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, false);
manager.ModifierFavEquip((Equipage)manager.SelectedItem, false);
bouttonFav.IsEnabled = true;
bouttonFav.Text = "Ajouter au favoris";
retirerFav.IsVisible = false;
}
private async void listMembre_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem=(Personnage)listMembre.SelectedItem;
await Navigation.PushAsync(new PageInfoPersonnage());
}
private async void listAlle_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem = (Equipage)listAlle.SelectedItem;
await Navigation.PushAsync(new PageInfoEquipage());
}
private async void Supprimer_Clicked(object sender, EventArgs e)
{
manager.SupprimerEquip((Equipage)manager.SelectedItem);
await Navigation.PopAsync();
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
listAlle.SelectedItem=null;
listMembre.SelectedItem=null;
}
private async void Modifier_Clicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync(nameof(ModalEquipage), true);
}
}

@ -29,6 +29,10 @@
<Frame Style="{StaticResource frameInfo}" >
<Label Text="3 Utilisateurs" TextColor="#72a3b3"/>
</Frame>
<FlexLayout AlignItems="Start" Wrap="Wrap" Direction="Row" JustifyContent="SpaceEvenly" >
<Button Text="Supprimer" Style="{StaticResource buttonRetirerFavInfo}" Clicked="Supprimer_Clicked" FlexLayout.Basis="49.5%"/>
<Button Text="Modifier" Style="{StaticResource buttonFavsInfo}" Clicked="Modifier_Clicked" FlexLayout.Basis="49.5%"/>
</FlexLayout>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="2" Padding="5">
<Frame Style="{StaticResource frameInfo}" >
@ -72,25 +76,18 @@
<Label Text="Description :" Style="{StaticResource titreInfo}"/>
<Line Stroke="#72a3b3" StrokeThickness="2" X1="0" X2="3000"/>
<Label Text="{Binding Description}" Style="{StaticResource paragrapheInfo}"/>
<Label Text="Utilisateurs :" Style="{StaticResource titreInfo}"/>
<Line Stroke="#72a3b3" StrokeThickness="2" X1="0" X2="3000"/>
<Label Text="Force / Faiblesses :" Style="{StaticResource titreInfo}"/>
<Line Stroke="#72a3b3" StrokeThickness="2" X1="0" X2="3000"/>
<Grid ColumnSpacing="20" Padding="7">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50*"/>
<ColumnDefinition Width="50*"/>
</Grid.ColumnDefinitions>
<Label Text="Forces :" Style="{StaticResource titreInfo}" />
<Label Text="{Binding Forces}" Style="{StaticResource paragrapheInfo}"/>
<Label Text="Faiblesses :" Style="{StaticResource titreInfo}" />
<Label Text="{Binding Faiblesses}" Style="{StaticResource paragrapheInfo}"/>
<VerticalStackLayout Grid.Column="0" Grid.Row="0">
<Label Text="Forces :" Style="{StaticResource titreInfo}" />
<Label Text="{Binding Forces}" Style="{StaticResource paragrapheInfo}"/>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Grid.Row="0">
<Label Text="Faiblesses :" Style="{StaticResource titreInfo}" />
<Label Text="{Binding Faiblesses}" Style="{StaticResource paragrapheInfo}"/>
</VerticalStackLayout>
</Grid>
<Label Text="Utilisateurs :" Style="{StaticResource titreInfo}"/>
<Line Stroke="#72a3b3" StrokeThickness="2" X1="0" X2="3000"/>
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -9,7 +9,7 @@ public partial class PageInfoFdd : ContentPage
public PageInfoFdd()
{
InitializeComponent();
if (manager.SelectedItem.EstFavori == true)
if (manager.SelectedItem?.EstFavori == true)
{
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
@ -22,7 +22,7 @@ public partial class PageInfoFdd : ContentPage
private void AjouterFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, true);
manager.ModifierFavFDD((FruitDuDemon)manager.SelectedItem, true);
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
@ -30,9 +30,19 @@ public partial class PageInfoFdd : ContentPage
private void RetirerFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, false);
manager.ModifierFavFDD((FruitDuDemon)manager.SelectedItem, false);
bouttonFav.IsEnabled = true;
bouttonFav.Text = "Ajouter au favoris";
retirerFav.IsVisible = false;
}
private async void Supprimer_Clicked(object sender, EventArgs e)
{
manager.SupprimerFDD((FruitDuDemon)manager.SelectedItem);
await Navigation.PopAsync();
}
private async void Modifier_Clicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync(nameof(ModalFDD), true);
}
}

@ -2,14 +2,11 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageInfoIle"
Title="PageInfoIle">
BackgroundColor="#e2edf1">
<ScrollView Grid.Row="0" Grid.Column="1" Orientation="Vertical" VerticalScrollBarVisibility="Always">
<VerticalStackLayout Spacing="10" Padding="40">
<Grid ColumnSpacing="20">
<VerticalStackLayout Spacing="10" Padding="40">
<Grid ColumnSpacing="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40*"/>
<ColumnDefinition Width="40*"/>
@ -26,54 +23,57 @@
<Frame Style="{StaticResource frameInfo}">
<Label Text="2 - Caracteristiques" TextColor="#72a3b3"/>
</Frame>
<FlexLayout AlignItems="Start" Wrap="Wrap" Direction="Row" JustifyContent="SpaceEvenly" >
<Button Text="Supprimer" Style="{StaticResource buttonRetirerFavInfo}" Clicked="Supprimer_Clicked" FlexLayout.Basis="49.5%"/>
<Button Text="Modifier" Style="{StaticResource buttonFavsInfo}" Clicked="Modifier_Clicked" FlexLayout.Basis="49.5%"/>
</FlexLayout>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">
<Label Style="{StaticResource titreInfo}" Text="{Binding Nom}"/>
</Frame>
<Frame Style="{StaticResource frameInfo}" >
<Image
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">
<Label Style="{StaticResource titreInfo}" Text="{Binding Nom}"/>
</Frame>
<Frame Style="{StaticResource frameInfo}" >
<Image
Source="{Binding Image}"
HeightRequest="200"
WidthRequest="300"
/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Nom Romanisé :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding NomRomanise}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Région :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Region}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Première apparition manga :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding PremierChap}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Première apparition anime :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding PremierEp}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
</VerticalStackLayout>
</Grid>
<Label Text="Description :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Description}" TextColor="#72a3b3" />
</VerticalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Nom Romanisé :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding NomRomanise}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Région :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Region}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Première apparition manga :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding PremierChap}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Première apparition anime :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding PremierEp}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
</VerticalStackLayout>
</Grid>
<Label Text="Description :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Description}" TextColor="#72a3b3" />
<Label Text="Géographie :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Geographie}" TextColor="#72a3b3" />
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -9,7 +9,7 @@ public partial class PageInfoIle : ContentPage
public PageInfoIle()
{
InitializeComponent();
if (manager.SelectedItem.EstFavori == true)
if (manager.SelectedItem?.EstFavori == true)
{
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
@ -22,7 +22,7 @@ public partial class PageInfoIle : ContentPage
private void AjouterFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, true);
manager.ModifierFavIle((Ile)manager.SelectedItem, true);
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
@ -30,9 +30,20 @@ public partial class PageInfoIle : ContentPage
private void RetirerFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, false);
manager.ModifierFavIle((Ile)manager.SelectedItem, false);
bouttonFav.IsEnabled = true;
bouttonFav.Text = "Ajouter au favoris";
retirerFav.IsVisible = false;
}
private async void Supprimer_Clicked(object sender, EventArgs e)
{
manager.SupprimerIle((Ile)manager.SelectedItem);
await Navigation.PopAsync();
}
private async void Modifier_Clicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync(nameof(ModalIle), true);
}
}

@ -3,18 +3,13 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageInfoPersonnage"
Title="PageInfoPersonnage"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<ScrollView Orientation="Vertical" VerticalScrollBarVisibility="Always">
<VerticalStackLayout Spacing="10" Padding="40">
<Grid ColumnSpacing="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40*"/>
<ColumnDefinition Width="40*"/>
</Grid.ColumnDefinitions>
<VerticalStackLayout Grid.Column="0" Spacing="4">
<Grid ColumnDefinitions="40*,40*" ColumnSpacing="30">
<VerticalStackLayout Spacing="4">
<Button x:Name="bouttonFav" Text="Ajouter aux favoris" Style="{StaticResource buttonFavsInfo}" Clicked="AjouterFav_Clicked" />
<Button x:Name="retirerFav" Text="Retirer des favoris" IsVisible="false" Style="{StaticResource buttonRetirerFavInfo}" Clicked="RetirerFav_Clicked"/>
<Frame Style="{StaticResource frameInfo}">
@ -32,58 +27,67 @@
<Frame Style="{StaticResource frameInfo}">
<Label Text="4 - Fruit(s)" TextColor="#72a3b3"/>
</Frame>
<FlexLayout AlignItems="Start" Wrap="NoWrap" Direction="Row" JustifyContent="SpaceEvenly" HorizontalOptions="Start">
<Button Text="Supprimer" Style="{StaticResource buttonRetirerFavInfo}" Clicked="Supprimer_Clicked" FlexLayout.Basis="49.5%"/>
<Button Text="Modifier" Style="{StaticResource buttonFavsInfo}" Clicked="Modifier_Clicked" FlexLayout.Basis="49.5%"/>
</FlexLayout>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">
<Label Style="{StaticResource titreInfo}" Text="{Binding Nom}" HorizontalOptions="Center"/>
</Frame>
<Frame Style="{StaticResource frameInfo}" >
<Image
Source="{Binding Image}"
HeightRequest="200"
WidthRequest="300"
/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Prime :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Prime}" TextColor="#72a3b3"/>
<Label Text="berrys" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Épithète :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Epithete}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Âge :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Age}" TextColor="#72a3b3"/>
<Label Text="ans" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Taille :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Taille}" TextColor="#72a3b3"/>
<Label Text="mètres" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Origine :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Origine}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<FlexLayout HorizontalOptions="Center" AlignItems="Start" Wrap="Wrap" Direction="Row" JustifyContent="Start" >
<Frame CornerRadius="25"
BorderColor="#e2edf1"
IsClippedToBounds="True"
Padding="0"
HeightRequest="400"
>
<Image
Source="{Binding Image}"
Aspect="AspectFit"
/>
</Frame>
<VerticalStackLayout Spacing="4">
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Prime :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Prime}" TextColor="#72a3b3"/>
<Label Text="berrys" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Épithète :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Epithete}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Âge :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Age}" TextColor="#72a3b3"/>
<Label Text="ans" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Taille :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Taille}" TextColor="#72a3b3"/>
<Label Text="mètres" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Origine :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Origine}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
</VerticalStackLayout>
</FlexLayout>
</VerticalStackLayout>
</Grid>
<Label Text="Biographie :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
@ -93,10 +97,50 @@
<Label Text="{Binding Citation}" Style="{StaticResource citationPerso}" />
<Label Text="Equipage(s) :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Equipage}" TextColor="#72a3b3" />
<CollectionView x:Name="listEquip" ItemsLayout="HorizontalList" ItemsSource="{Binding Equipage}" SelectionMode="Single" SelectionChanged="listEquip_SelectionChanged">
<CollectionView.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameEquip}" Margin="5">
<StackLayout Orientation="Vertical">
<Image Source="{Binding Image}"
HeightRequest="175"
WidthRequest="175"/>
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="15"
TextColor="white"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<Label Text="Fruit :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Fruit}" TextColor="#72a3b3" />
<CollectionView x:Name="listFruit" ItemsLayout="HorizontalList" ItemsSource="{Binding Fruit}" SelectionMode="Single" SelectionChanged="listFruit_SelectionChanged">
<CollectionView.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameEquip}" Margin="5">
<StackLayout Orientation="Vertical">
<Image Source="{Binding Image}"
HeightRequest="175"
WidthRequest="175"/>
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="15"
TextColor="white"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>

@ -10,7 +10,7 @@ public partial class PageInfoPersonnage : ContentPage
public PageInfoPersonnage()
{
InitializeComponent();
if (manager.SelectedItem.EstFavori == true)
if (manager.SelectedItem?.EstFavori == true)
{
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
@ -23,7 +23,7 @@ public partial class PageInfoPersonnage : ContentPage
private void AjouterFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, true);
manager.ModifierFavPerso((Personnage)manager.SelectedItem, true);
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
@ -31,9 +31,42 @@ public partial class PageInfoPersonnage : ContentPage
private void RetirerFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavoris(manager.SelectedItem, false);
manager.ModifierFavPerso((Personnage)manager.SelectedItem, false);
bouttonFav.IsEnabled = true;
bouttonFav.Text = "Ajouter au favoris";
retirerFav.IsVisible = false;
}
private async void listEquip_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem = (Equipage)listEquip.SelectedItem;
await Navigation.PushAsync(new PageInfoEquipage());
}
private async void listFruit_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem = (FruitDuDemon)listFruit.SelectedItem;
await Navigation.PushAsync(new PageInfoFdd());
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
listEquip.SelectedItem = null;
listFruit.SelectedItem = null;
}
private async void Supprimer_Clicked(object sender, EventArgs e)
{
manager.SupprimerPerso((Personnage)manager.SelectedItem);
await Navigation.PopAsync();
}
private async void Modifier_Clicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync(nameof(ModalPersonnage), true);
}
}

@ -3,19 +3,15 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PagePersonnage"
Title="PagePersonnage"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<VerticalStackLayout Spacing="40">
<Grid ColumnDefinitions="200,*,100,10,100" BackgroundColor="#72a3b3" Padding="10">
<VerticalStackLayout Spacing="10">
<Grid ColumnDefinitions="200,*,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="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="4">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
<Button Text="Ajouter" Clicked="ButtonAjouter_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="2"/>
</Grid>
@ -29,7 +25,7 @@
<ColumnDefinition Width="400"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="750"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Frame CornerRadius="25"
@ -73,6 +69,6 @@
</CollectionView.ItemTemplate>
</CollectionView>
</ScrollView>
</VerticalStackLayout>
</VerticalStackLayout>
</ContentPage>

@ -13,16 +13,31 @@ public partial class PagePersonnage : ContentPage
{
InitializeComponent();
BindingContext = manager;
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
listePerso.ItemsSource = manager.RechercheObjetOhara(searchBar.Text, new List<ObjetOhara>(manager.Personnages.ToList()));
}
searchBar.TextChanged += OnTextChanged;
}
void listePerso_SelectionChanged(object sender, SelectionChangedEventArgs e)
async void listePerso_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem = (Personnage)listePerso.SelectedItem;
Navigation.PushAsync(new PageInfoPersonnage());
await Shell.Current.GoToAsync(nameof(PageInfoPersonnage));
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
manager.SelectedItem = null;
listePerso.SelectedItem = null;
}
private async void ButtonAjouter_Clicked(object sender, EventArgs e)
{
manager.SelectedItem = null;
await Navigation.PushModalAsync(new ModalPersonnage());
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 788 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Ohara.Resources
{
static class IconFont
{
public const string Perso = "\ue738";
public const string Fav = "\ue72c";
public const string Equip = "\ue72e";
public const string Icon4 = "\ue75b";
public const string Suppr = "\ue732";
public const string Add = "\ue70d";
public const string Modif = "\ue736";
}
}

@ -402,156 +402,24 @@
<Setter Property="SelectedTabColor" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}" />
</Style>
<Style TargetType="Button" x:Key="buttonMenu">
<Setter Property="BackgroundColor" Value="#bfe5ef"/>
<Setter Property="FontFamily" Value="OpenSans"/>
<Setter Property="FontAttributes" Value="Bold" />
<Setter Property="FontSize" Value="20"/>
<Setter Property="TextColor" Value="White"/>
<Setter Property="CornerRadius" Value="0"/>
<Setter Property="WidthRequest" Value="250"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="#bfe5ef"/>
<Setter Property="WidthRequest" Value="250"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="#cdffd8" Offset="0.1" />
<GradientStop Color="#94b9ff" Offset="1.0" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="WidthRequest" Value="275" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="Button" x:Key="buttonMenu2">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="#cdffd8" Offset="0.1" />
<GradientStop Color="#94b9ff" Offset="1.0" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="FontFamily" Value="OpenSans"/>
<Setter Property="FontAttributes" Value="Bold" />
<Setter Property="FontSize" Value="20"/>
<Setter Property="TextColor" Value="White"/>
<Setter Property="CornerRadius" Value="0"/>
<Setter Property="WidthRequest" Value="275" />
</Style>
<Style TargetType="Label" x:Key="titreInfo">
<Setter Property="FontFamily" Value="OpenSans"/>
<Setter Property="FontAttributes" Value="Bold" />
<Setter Property="FontSize" Value="20"/>
<Setter Property="TextColor" Value="#72a3b3"/>
</Style>
<Style TargetType="Frame" x:Key="frameInfo">
<Setter Property="BackgroundColor" Value="White"/>
<Setter Property="BorderColor" Value="#72a3b3"/>
</Style>
<Style x:Key="RespCollection"
TargetType="CollectionView">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Petit">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="0" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Property="ItemsLayout"
Value="VerticalGrid, 1" />
<Setter Property="BackgroundColor"
Value="Green"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Moyen">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="480" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Property="ItemsLayout"
Value="VerticalGrid, 2" />
<Setter Property="BackgroundColor"
Value="Blue"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Grand">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="900" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Property="ItemsLayout"
Value="HorizontalList" />
<Setter Property="BackgroundColor"
Value="Red"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<!--<Style x:Key="GIL"
TargetType="CollectionView.ItemsLayout">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Petit">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="0" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Collecto
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Moyen">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="480" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Property="Span"
Value="2" />
<Style TargetType="Frame" x:Key="frameModif">
<Setter Property="BackgroundColor" Value="#72a3b3"/>
<Setter Property="BorderColor" Value="#72a3b3"/>
</Style>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Grand">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="900" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Property="Span"
Value="4" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>-->
<Style x:Key="frameObjet" TargetType="Frame">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
@ -650,10 +518,12 @@
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="#72a3b3"/>
<Setter Property="TextColor" Value="White"/>
<Setter Property="BackgroundColor" Value="White"/>
<Setter Property="TextColor" Value="#72a3b3"/>
<Setter Property="BorderColor" Value="#72a3b3"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="Padding" Value="17"/>
<Setter Property="FontAttributes" Value="Bold"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
@ -670,6 +540,7 @@
<Setter Property="FontSize" Value="20"/>
<Setter Property="Padding" Value="17"/>
<Setter Property="BorderColor" Value="Transparent"/>
<Setter Property="FontAttributes" Value="Bold"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Disabled">
@ -678,7 +549,7 @@
<Setter Property="TextColor" Value="White"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="Padding" Value="17"/>
<Setter Property="FontAttributes" Value="Bold"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
@ -692,11 +563,12 @@
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="DarkRed"/>
<Setter Property="TextColor" Value="White"/>
<Setter Property="BackgroundColor" Value="White"/>
<Setter Property="TextColor" Value="Red"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="Padding" Value="17"/>
<Setter Property="BorderColor" Value="DarkRed"/>
<Setter Property="BorderColor" Value="Red"/>
<Setter Property="FontAttributes" Value="Bold"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
@ -706,6 +578,7 @@
<Setter Property="FontSize" Value="20"/>
<Setter Property="Padding" Value="17"/>
<Setter Property="BorderColor" Value="Red"/>
<Setter Property="FontAttributes" Value="Bold"/>
</VisualState.Setters>
</VisualState>
@ -715,18 +588,101 @@
</Style>
<!--<Style TargetType="Label"
Class="FlyoutItemLabelStyle">
<Setter Property="TextColor"
Value="White" />
<Setter Property="WidthRequest" Value="250"/>
<Setter Property="HorizontalOptions" Value="Center"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="TextColor" Value="Black"/>
<Setter Property="FontSize" Value="15"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="TextColor" Value="Black"/>
<Setter Property="FontSize" Value="15"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="TextColor" Value="Black"/>
<Setter Property="FontSize" Value="15"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="Layout"
Class="FlyoutItemLayoutStyle"
ApplyToDerivedTypes="True">
<Setter Property="BackgroundColor"
Value="Teal" />
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="White"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>-->
<Style TargetType="Picker" x:Key="pickerOhara">
<Setter Property="BackgroundColor" Value="#bfe5ef"/>
<Setter Property="TextColor" Value="#72a3b3"/>
<Setter Property="TitleColor" Value="White"/>
</Style>
<Style TargetType="SearchBar" x:Key="searchBarOhara">
<Setter Property="BackgroundColor" Value="#bfe5ef"/>
<Setter Property="TextColor" Value="#72a3b3"/>
</Style>
<Style TargetType="Button" x:Key="buttonBarre">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="#bfe5ef"/>
<Setter Property="TextColor" Value="#72a3b3"/>
<Setter Property="FontAttributes" Value="Bold"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="#cdffd8" Offset="0.1" />
<GradientStop Color="#94b9ff" Offset="0.8" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="TextColor" Value="#72a3b3"/>
<Setter Property="FontAttributes" Value="Bold"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style x:Key="InvalidEntryStyle" TargetType="Entry">
<Setter Property="TextColor" Value="Red" />
</Style>
<Style x:Key="ValidEntryStyle" TargetType="Entry">
<Setter Property="TextColor" Value="Green" />
</Style>
</ResourceDictionary>

Loading…
Cancel
Save