PropertyChangedEventManager::AddHandler Method (INotifyPropertyChanged^, EventHandler<PropertyChangedEventArgs^>^, String^)

.NET Framework (current version)
 

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".

Exception Condition
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
Available since 4.5
Return to top
Show: