using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ComponentModel; using System.Runtime.CompilerServices; namespace Model { public class Pack : IContenu, INotifyPropertyChanged { public event PropertyChangedEventHandler? PropertyChanged; void OnPropertyChanged([CallerMemberName] string? propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } public string Nom { get; set; } public string Description { get; set; } private int? note; public int? Note { get { return note; } set { if (value < 0 || value > 10) { throw new ArgumentOutOfRangeException(nameof(value), "La valeur de la note doit être comprise entre 0 et 10."); } note = value; OnPropertyChanged(nameof(Note)); } } public Pack(string nom, string description, int? note) { Nom = nom; Description = description; Note = note; } } }