Partager via


RoutedEventArgs Class

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Contains state information and event data associated with a routed event.

Inheritance Hierarchy

System.Object
  System.EventArgs
    System.Windows.RoutedEventArgs
      More...

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public Class RoutedEventArgs _
    Inherits EventArgs
public class RoutedEventArgs : EventArgs

The RoutedEventArgs type exposes the following members.

Constructors

  Name Description
Public methodSupported by Silverlight for Windows Phone RoutedEventArgs Initializes a new instance of the RoutedEventArgs class.

Top

Properties

  Name Description
Public propertySupported by Silverlight for Windows Phone OriginalSource Gets a reference to the object that raised the event.

Top

Methods

  Name Description
Public methodSupported by Silverlight for Windows Phone Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows Phone Finalize Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone GetType Gets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows Phone MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Remarks

This class is responsible for packaging the event data for a routed event, providing extra event state information, and is used by the event system for invoking the handler associated with the routed event.

The most relevant information carried in the event data is the OriginalSource, which reports the object that first raised the event. In the case of a bubbling routed event, this could be a different object in the element tree than the object where the handler being invoked is attached.

In WPF, there is a concept of a Source property that is separate from OriginalSource. This distinction is not present in Silverlight, because classes cannot adjust the reported source of a routed event in the Silverlight event system. (In WPF, control classes sometimes adjust the event source as part of their compositing logic.)

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Other Resources

Inheritance Hierarchy

System.Object
  System.EventArgs
    System.Windows.RoutedEventArgs
      System.Windows.Controls.CalendarDateChangedEventArgs
      System.Windows.Controls.CalendarModeChangedEventArgs
      System.Windows.Controls.CleanUpVirtualizedItemEventArgs
      System.Windows.Controls.ContentChangedEventArgs
      System.Windows.Controls.PopulatedEventArgs
      System.Windows.Controls.PopulatingEventArgs
      System.Windows.Controls.Primitives.DragCompletedEventArgs
      System.Windows.Controls.Primitives.DragDeltaEventArgs
      System.Windows.Controls.Primitives.DragStartedEventArgs
      System.Windows.Controls.Primitives.ScrollEventArgs
      System.Windows.Controls.RoutedPropertyChangingEventArgs<T>
      System.Windows.Controls.SelectionChangedEventArgs
      System.Windows.Controls.SubImageRoutedEventArgs
      System.Windows.Controls.TextChangedEventArgs
      System.Windows.Controls.ValidationErrorEventArgs
      System.Windows.DragEventArgs
      System.Windows.ExceptionRoutedEventArgs
      System.Windows.Input.KeyEventArgs
      System.Windows.Input.MouseEventArgs
      System.Windows.Input.TextCompositionEventArgs
      System.Windows.Media.LogReadyRoutedEventArgs
      System.Windows.Media.MediaCommandEventArgs
      System.Windows.Media.RateChangedRoutedEventArgs
      System.Windows.Media.TimelineMarkerRoutedEventArgs
      System.Windows.RoutedPropertyChangedEventArgs<T>
      System.Windows.SizeChangedEventArgs