1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| public enum EnumLimitation
{
Aucune,
Légère,
Modérée,
Forte,
Totale,
}
public class Limitation : INotifyPropertyChanged
{
public int _id { get; set; }
private EnumLimitation _enumLimitation = EnumLimitation.Modérée;
public EnumLimitation _limitation
{
get { return _enumLimitation; }
set
{
_enumLimitation = value;
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs("Limitation"));
}
}
public Limitation() { }
public Limitation(int id = 0)
{
_id = id;
}
public event PropertyChangedEventHandler PropertyChanged;
}
public class Limitations : ObservableCollection<Limitation>
{
public override string ToString()
{
string s = "";
foreach (var item in this)
{
s += item.ToString() + "\n";
}
return s;
}
} |
Partager