MouseEventArgs Class
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Provides data for pointer-related events that do not specifically involve device buttons, for example UIElement::MouseMove which includes Windows Phone pointer movement.
System::EventArgs
System.Windows::RoutedEventArgs
System.Windows.Input::MouseEventArgs
System.Windows.Input::MouseButtonEventArgs
System.Windows.Input::MouseWheelEventArgs
Assembly: System.Windows (in System.Windows.dll)
The MouseEventArgs type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | OriginalSource | Gets a reference to the object that raised the event. (Inherited from RoutedEventArgs.) |
![]() | StylusDevice | Gets an object that reports stylus device information, such as the collection of stylus points associated with the input. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | 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.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetPosition | Returns the x- and y-coordinates of the pointer position, optionally evaluated against a coordinate origin of a supplied UIElement. |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
This event data class is used with the following events.
Note that events that specifically deal with mouse button events use a different event data class, MouseButtonEventArgs. You can use the shared API (MouseEventArgs::GetPosition or MouseEventArgs::StylusDevice) for any pointer event through event handling and the event data.
The most relevant member of MouseEventArgs is GetPosition, which is a method, not a property. Particularly for a click event, or for cases where the pointer is captured, it is often useful to know the exact pointer position at time of the event. GetPosition returns that position relative to the Windows Phone coordinate space, or optionally against the specific coordinate space of a supplied reference element.


