public static void Main()
 {
     var student = new Student("Koko", 19);
     student.OnChange += EventChanges;
     student.Name = "Milko";
     student.Age = 21;
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Student student = new Student("Peter", 22);

            student.PropertyChanged += (sender, eventArgs) =>
            {
                Console.WriteLine("Property changed: {0} (from {1} to {2})",
                    eventArgs.PropertyName, eventArgs.OldValue, eventArgs.NewValue);
            };

            student.Name = "Maria";
            student.Age = 19;
        }