Export (0) Print
Expand All

PropertyChangedEventManager.AddHandler Method

.NET Framework 4.6 and 4.5

Adds the specified event handler, which is called when specified source raises the PropertyChanged event for the specified property.

Namespace:  System.ComponentModel
Assembly:  WindowsBase (in WindowsBase.dll)

public static void AddHandler(
	INotifyPropertyChanged source,
	EventHandler<PropertyChangedEventArgs> handler,
	string propertyName
)

Parameters

source
Type: System.ComponentModel.INotifyPropertyChanged

The source object that the raises the PropertyChanged event.

handler
Type: System.EventHandler<PropertyChangedEventArgs>

The delegate that handles the PropertyChanged event.

propertyName
Type: System.String

The name of the property that exists on source upon which to listen for changes. Set to Empty to indicate "any property".

ExceptionCondition
ArgumentNullException

handler is null.

NotSupportedException

More than one method is associated with handler.

Use this method to specify the event handler you want to use to subscribe to the PropertyChanged event.. When you use this method, your listener object does not need to implement the IWeakEventListener interface.

.NET Framework

Supported in: 4.6, 4.5
Show:
© 2015 Microsoft