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
- modelEvent
Type: Microsoft.Windows.Design.Model.ModelEvent
The event to handle.
- methodName
Type: System.String
The method to declare.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.Windows.Design.Services Namespace