PropertyStoreAddHandlerEvent Method |
Adds a handler-based event delegate with the specified key
Namespace:
Eto
Assembly:
Eto (in Eto.dll) Version: 2.5.3-dev
Syntax public void AddHandlerEvent(
string key,
Delegate value
)
Public Sub AddHandlerEvent (
key As String,
value As Delegate
)
member AddHandlerEvent :
key : string *
value : Delegate -> unit
Parameters
- key
- Type: SystemString
Key of the event to add to - value
- Type: SystemDelegate
Delegate to add to the event
Remarks
This should be called in an event's add accessor.
This is used for any event that should be triggered by the platform handler.
This will call
HandleEvent(string, bool) with the specified
key for the
first subscription to the event.
You can use any subclass of
EventArgs for the type of event handler
To trigger the event, use
TriggerEventT(Object, Object, T)Examples
Example implementation of a handler-triggered event
public const string MySomethingEvent = "MyControl.MySomething";
public event EventHandler<EventArgs> MySomething
{
add { Properties.AddHandlerEvent(MySomethingEvent, value); }
remove { Properties.RemoveHandlerEvent(MySomethingEvent, value); }
}
See Also