public void UsingModelObjectAsStronglyTyped()
{
var person = new Person();
// Casting first to dynamic triggers the DelegatingObjects casting system
INotifyPropertyChanges inpc = (dynamic) person;
inpc.PropertyChanged +=
( sender, args ) => Console.WriteLine( "The field {0} has changed.", args.PropertyName );
inpc.PropertyChanging +=
( sender, args ) => Console.WriteLine( "The field {0} is changing.", args.PropertyName );
// We have full IntelliSense when working with person.
// We have full IntelliSense when working with person.
person.Name = "Inigo Montoya";
}