O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing INotifyPropertyChanged: The Traditional Approach

The INotifyPropertyChanged interface has a single event called PropertyChanged. The implementation of INotifyPropertyChanged ordinarily includes the following construct:

public event PropertyChangedEventHandler PropertyChanged;protected virtual void OnPropertyChanged(        [CallerMemberName] string propertyName = null){    PropertyChangedEventHandler tempEvent = PropertyChanged;    if (tempEvent != null)    {        tempEvent(this, new PropertyChangedEventArgs(propertyName));    }}

The CallerMemberName attribute is used by a new compiler feature that automatically passes the name of the calling member to the target method. No longer is it necessary in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required