예제 #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";
        }
예제 #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";
        }