using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; namespace Model { public class Animal : INotifyPropertyChanged { public event PropertyChangedEventHandler? PropertyChanged; public string Nom { get => nom; set { if (nom == value) return; nom = value; OnPropertyChanged(nameof(Nom)); } } private string nom; public string DateNaissance { get => dateNaissance; set { if (dateNaissance == value) return; dateNaissance = value; OnPropertyChanged(nameof(DateNaissance)); } } private string dateNaissance; public string Sexe { get => sexe; set { if (sexe == value) return; sexe = value; OnPropertyChanged(nameof(Sexe)); } } private string sexe; public string DateAdoption { get => dateAdoption; set { if (dateAdoption == value) return; dateAdoption = value; OnPropertyChanged(nameof(DateAdoption)); } } private string dateAdoption; public float? Taille { get => taille; set { if (taille == value) return; taille = value; OnPropertyChanged(nameof(Taille)); } } private float? taille; public float? Poids { get => poids; set { if (poids == value) return; poids = value; OnPropertyChanged(nameof(Poids)); } } private float? poids; public string Alimentation { get => alimentation; set { if (alimentation == value) return; alimentation = value; OnPropertyChanged(nameof(Alimentation)); } } private string alimentation; public Espece Espece { get => espece; set { if (espece == value) return; espece = value; OnPropertyChanged(nameof(Espece)); } } private Espece espece; public Race? Race { get; set; } public Animal(string nom = "", string dateNaissance = "Inconnue", string sexe = "Inconnu", string dateAdpotion = "Inconnue", float? taille = null, float? poids = null, string alimentation = "Inconnue", Race? race = null) { Nom = nom; DateNaissance = dateNaissance; Sexe = sexe; DateAdoption = dateAdpotion; Taille = taille; Poids = poids; Alimentation = alimentation; Race = race; } void OnPropertyChanged(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } } }