From 63f4d4e3e5e4272e2a009ee13b6063fe5bfce8b6 Mon Sep 17 00:00:00 2001 From: Adri Date: Mon, 8 Oct 2018 08:23:15 +0200 Subject: [PATCH] debut cours --- ISET2018_WPF/Fen3.xaml.cs | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/ISET2018_WPF/Fen3.xaml.cs b/ISET2018_WPF/Fen3.xaml.cs index d2579d1..7a25f07 100644 --- a/ISET2018_WPF/Fen3.xaml.cs +++ b/ISET2018_WPF/Fen3.xaml.cs @@ -11,7 +11,7 @@ using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; - +using System.ComponentModel; namespace ISET2018_WPF { /// @@ -24,4 +24,39 @@ namespace ISET2018_WPF InitializeComponent(); } } + public class Data : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void onPropertyChanged(string PropertyName) + { + PropertyChangedEventHandler Handler = PropertyChanged; + if (Handler != null) + Handler(this, new PropertyChangedEventArgs(PropertyName)); + } + } + public class Personne : Data + { + private int id; + private string nom, pre; + + public int Id { get => id; set => id = value; } + public string Nom { get => nom; set => nom = value; } + public string Pre { get => pre; set => pre = value; } + + public Personne() + { + + } + public Personne(string nom, string pre) + { + Id = -1; + Nom = nom; Pre = pre; + } + public Personne(int id, string nom, string pre) + { + Id = id;Nom = nom;Pre = pre; + } + + } }