Exercise: Observer design pattern: INotifyPropertyChangXX

In this exercise you must use the Observer design pattern.

This exercise is very similar to the example NotifyPropertyChangeSmallExample.

Before getting started

Read and understand the example NotifyPropertyChangeSmallExample.

Getting started

Create a new Solution in Visual Studio. Give the solution an appropriate name like ObserverNotifyPropertyChange

Class Teacher : INotifyPropertyChanged

Create a class Teacher with properties like Name, Salary, etc.

The Teacher class must implement the interface INotifyPropertyChanged.

After a change in the properties value all Observers must be notified.

Main

Make a Main(...) method that make a Teacher object and add at least one observer to the object.

Unit test

Make a Unit test to check that the Teacher object really sends events when the property values are changed.

Class Teacher : INotifyPropertyChanging

The Teacher class must implement the interface INotifyPropertyChanging.

Try with Main() + Unit test.