Class RoutedEventArgs
The container for all state associated with a RoutedEvent
Inherited Members
Namespace: nanoFramework.UI
Assembly: nanoFramework.Graphics.dll
Syntax
public class RoutedEventArgs : EventArgs
Remarks
RoutedEventArgs constitutes the
RoutedEvent, Handled, Source and OriginalSourceDifferent RoutedEventArgs can be used with a single RoutedEvent
The RoutedEventArgs is responsible for packaging the RoutedEvent, providing extra event state info, and invoking the handler associated with the RoutedEvent
Constructors
RoutedEventArgs()
Constructor for RoutedEventArgs
Declaration
public RoutedEventArgs()
Remarks
All members take default values
RoutedEvent defaults to null
Handled defaults to false Source defaults to null OriginalSource also defaults to nullRoutedEventArgs(RoutedEvent, object)
Constructor for RoutedEventArgs
Declaration
public RoutedEventArgs(RoutedEvent routedEvent, object source)
Parameters
Type | Name | Description |
---|---|---|
RoutedEvent | routedEvent | The new value that the RoutedEvent Property is being set to |
object | source | The new value that the SourceProperty is being set to |
RoutedEventArgs(RoutedEvent)
Constructor for RoutedEventArgs
Declaration
public RoutedEventArgs(RoutedEvent routedEvent)
Parameters
Type | Name | Description |
---|---|---|
RoutedEvent | routedEvent | The new value that the RoutedEvent Property is being set to |
Properties
Handled
Returns a boolean flag indicating if or not this RoutedEvent has been handled this far in the route
Declaration
public bool Handled { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
Initially starts with a false value before routing has begun
OriginalSource
Returns OriginalSource object that raised the RoutedEvent
Declaration
public object OriginalSource { get; }
Property Value
Type | Description |
---|---|
object |
Remarks
Always returns the OriginalSource object that raised the RoutedEvent unlike Source that may vary under specific scenarios
This property acquires its value once before the event handlers are invoked and never changes then onRoutedEvent
Returns the RoutedEvent associated with this RoutedEventArgs
Declaration
public RoutedEvent RoutedEvent { get; set; }
Property Value
Type | Description |
---|---|
RoutedEvent |
Remarks
The RoutedEvent cannot be null at any time
Source
Returns Source object that raised the RoutedEvent
Declaration
public object Source { get; set; }
Property Value
Type | Description |
---|---|
object |
Methods
OnSetSource(object)
Invoked when the source of the event is set
Declaration
protected virtual void OnSetSource(object source)
Parameters
Type | Name | Description |
---|---|---|
object | source | The new value that the SourceProperty is being set to |
Remarks
Changing the source of an event can often require updating the data within the event. For this reason, the OnSource= method is protected virtual and is meant to be overridden by sub-classes of RoutedEventArgs
Also see Source