Passage en List pour les commentaires, ajout du OnPropertyCHange pour le pack et les commentaires et quelques corrections dans le code
continuous-integration/drone/push Build is failing Details

master
Loris OBRY 2 years ago
parent 1d23609474
commit 45dfdb77d6

@ -67,12 +67,21 @@ namespace Model
get => lienImage; get => lienImage;
set set
{ {
if (!string.IsNullOrEmpty(lienImage)) lienImage = "notfound"; if (string.IsNullOrEmpty(lienImage)) lienImage = "notfound";
else lienImage = value; else lienImage = value;
OnPropertyChanged(nameof(LienImage)); OnPropertyChanged(nameof(LienImage));
} }
} }
public IEnumerable<IContenu> ContenuList { get; set; } public List<Commentaire> commentaires;
public List<Commentaire> Commentaires
{
get => commentaires;
set
{
commentaires = value;
OnPropertyChanged(nameof(Commentaires));
}
}
private string lienImage; private string lienImage;
public Carte(string nom, string pouvoir, string strategie, int? note, string lienImage, string description) public Carte(string nom, string pouvoir, string strategie, int? note, string lienImage, string description)
{ {
@ -82,7 +91,7 @@ namespace Model
this.strategie = strategie; this.strategie = strategie;
this.note = note; this.note = note;
this.lienImage = lienImage; this.lienImage = lienImage;
this.ContenuList = new List<IContenu>(); this.commentaires = new List<Commentaire>();
} }
} }
} }

@ -16,9 +16,25 @@ namespace Model
{ {
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
} }
public string nom;
public string Nom { get; set; } public string Nom
public string Description { get; set; } {
get => nom;
set
{
nom = value;
OnPropertyChanged(nameof(Nom));
}
}
public string description;
public string Description {
get => description;
set
{
nom = value;
OnPropertyChanged(nameof(Description));
}
}
private int? note; private int? note;
public int? Note public int? Note
{ {
@ -36,11 +52,22 @@ namespace Model
OnPropertyChanged(nameof(Note)); OnPropertyChanged(nameof(Note));
} }
} }
public List<Commentaire> commentaires;
public List<Commentaire> Commentaires
{
get => commentaires;
set
{
commentaires = value;
OnPropertyChanged(nameof(Commentaires));
}
}
public Pack(string nom, string description, int? note) public Pack(string nom, string description, int? note)
{ {
Nom = nom; this.nom = nom;
Description = description; this.description = description;
Note = note; this.note = note;
this.commentaires = new List<Commentaire>();
} }
} }
} }

Loading…
Cancel
Save