Exemplo n.º 1
0
        private static void RunWithEvents()
        {
            var person = new EventPerson {
                Name = "Erik"
            };

            // Listen for property changes
            person.PropertyChanged += OnPropertyChanged;

            // Change the values
            person.Name = "Bart";
            person.Name = "Matthew";
            person.Name = "Matthew";
            person.Name = "Steve";

            person.PropertyChanged -= OnPropertyChanged;

            person.Name = "Bill";
        }
Exemplo n.º 2
0
        private static void RunWithEvents()
        {
            var person = new EventPerson { Name = "Erik" };

            // Listen for property changes
            person.PropertyChanged += OnPropertyChanged;

            // Change the values
            person.Name = "Bart";
            person.Name = "Matthew";
            person.Name = "Matthew";
            person.Name = "Steve";

            person.PropertyChanged -= OnPropertyChanged;

            person.Name = "Bill";
        }