Feedback

C# - INotifyPropertyChanged implementation with event pattern

Veröffentlicht von am 8/24/2010
(2 Bewertungen)
The whole EventPattern conform implementation of INotifyPropertyChanged.

Nothing special, just useful in daily business.
       #region INotifyPropertyChanged Members

        /// <summary>
        /// Raises the propertyChangedEvent
        /// </summary>
        /// <param name="propertyName">Name of the property, which has been changed.</param>
        private void onNotifyPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;

            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }


        /// <summary>
        /// Occurs when a property value changes.
        /// </summary>
        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

Kommentare zum Snippet

 

Logge dich ein, um hier zu kommentieren!