EventBindingService.AddEventHandler Method

When overridden in a derived class, requests that a specified method be declared as handling a specified event.

Namespace:  Microsoft.Windows.Design.Services
Assembly:  Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)

Syntax

'Declaration
Public MustOverride Function AddEventHandler ( _
    modelEvent As ModelEvent, _
    methodName As String _
) As Boolean
public abstract bool AddEventHandler(
    ModelEvent modelEvent,
    string methodName
)
public:
virtual bool AddEventHandler(
    ModelEvent^ modelEvent, 
    String^ methodName
) abstract
abstract AddEventHandler : 
        modelEvent:ModelEvent * 
        methodName:string -> bool 
public abstract function AddEventHandler(
    modelEvent : ModelEvent, 
    methodName : String
) : boolean

Parameters

Return Value

Type: System.Boolean
true if the method can be successfully declared in the code-behind file to handle the given event; otherwise, false.

Remarks

The method specified by methodName must already exist. A new method can be created by calling CreateMethod.

In C#, this method always returns false. In Visual Basic, the Handles clause can be used.

.NET Framework Security

See Also

Reference

EventBindingService Class

Microsoft.Windows.Design.Services Namespace

ModelEditingScope

ModelEventCollection

Other Resources

WPF Designer Extensibility Architecture