Skip to end of metadata
Go to start of metadata

Provides event management for mouse operations, including mouse-related routed events and functions.

Working with DisableSilverlightContextMenu Property

This property is only applicable in Silverlight 3 or higher.

Definition

public static class Mouse

Summary

The following table summarizes the members exposed in this class.

Static Properties

DisableSilverlightContextMenuSpecifies whether the built-in Silverlight context menu should be disabled.
DoubleClickDurationGets or sets the latency of the click before double click event is raised.
IsMouseWheelSupportedDetermines whether the mouse wheel is supported in the current application.
LastMouseButtonGets the last changed button of the mouse.
LastMouseButtonStateGets the last state of the changed button.
LeftButtonGets the state of the left button of the mouse.
MiddleButtonGets the state of the middle button of the mouse.
RightButtonGets the state of the right button of the mouse.

Fields

GotMouseCaptureEventIdentifies the GotMouseCapture routed event.
LostMouseCaptureEventIdentifies the LostMouseCapture routed event.
MouseDownEventIdentifies the MouseDown routed event.
MouseEnterEventIdentifies the MouseEnter routed event.
MouseLeaveEventIdentifies the MouseLeave routed event.
MouseMoveEventIdentifies the MouseMove routed event.
MouseUpEventIdentifies the MouseUp routed event.
MouseWheelEventIdentifies the MouseWheel routed event.
PreviewMouseDownEventIdentifies the PreviewMouseDown routed event.
PreviewMouseMoveEventIdentifies the PreviewMouseMove routed event.
PreviewMouseUpEventIdentifies the PreviewMouseUp routed event.
PreviewMouseWheelEventIdentifies the PreviewMouseWheel routed event.

Static Methods

AddGotMouseCapture(DependencyObject, MouseEventHandler) 
AddLostMouseCapture(DependencyObject, MouseEventHandler) 
AddMouseDownHandler(UIElement, MouseButtonEventHandler) 
AddMouseDownHandler(UIElement, MouseButtonEventHandler, bool) 
AddMouseEnterHandler(DependencyObject, MouseEventHandler) 
AddMouseLeaveHandler(DependencyObject, MouseEventHandler) 
AddMouseMoveHandler(DependencyObject, MouseEventHandler) 
AddMouseUpHandler(UIElement, MouseButtonEventHandler) 
AddMouseWheelHandler(DependencyObject, MouseWheelEventHandler) 
AddPreviewMouseDownHandler(UIElement, MouseButtonEventHandler) 
AddPreviewMouseMoveHandler(DependencyObject, MouseEventHandler) 
AddPreviewMouseUpHandler(UIElement, MouseButtonEventHandler) 
AddPreviewMouseWheelHandler(DependencyObject, MouseWheelEventHandler) 
Capture(UIElement) 
GetPosition(UIElement) 
ReleaseCapture(UIElement) 
RemoveGotMouseCapture(DependencyObject, MouseEventHandler) 
RemoveLostMouseCapture(DependencyObject, MouseEventHandler) 
RemoveMouseDownHandler(UIElement, MouseButtonEventHandler) 
RemoveMouseEnterHandler(DependencyObject, MouseEventHandler) 
RemoveMouseLeaveHandler(DependencyObject, MouseEventHandler) 
RemoveMouseMoveHandler(DependencyObject, MouseEventHandler) 
RemoveMouseUpHandler(UIElement, MouseButtonEventHandler) 
RemoveMouseWheelHandler(DependencyObject, MouseWheelEventHandler) 
RemovePreviewMouseDownHandler(UIElement, MouseButtonEventHandler) 
RemovePreviewMouseMoveHandler(DependencyObject, MouseEventHandler) 
RemovePreviewMouseUpHandler(UIElement, MouseButtonEventHandler) 
RemovePreviewMouseWheelHandler(DependencyObject, MouseWheelEventHandler) 

Static Properties

public static bool DisableSilverlightContextMenu { get; set; }

Specifies whether the built-in Silverlight context menu should be disabled.

Remarks

This property is only applicable in Silverlight 3 or higher.

 

public static TimeSpan DoubleClickDuration { get; set; }

Gets or sets the latency of the click before double click event is raised.

public static bool IsMouseWheelSupported { get; }

Determines whether the mouse wheel is supported in the current application.

public static Nullable<MouseButton> LastMouseButton { get; set; }

Gets the last changed button of the mouse.

public static Nullable<MouseButtonState> LastMouseButtonState { get; set; }

Gets the last state of the changed button.

public static MouseButtonState LeftButton { get; }

Gets the state of the left button of the mouse.

public static MouseButtonState MiddleButton { get; }

Gets the state of the middle button of the mouse.

public static MouseButtonState RightButton { get; }

Gets the state of the right button of the mouse.

Fields

public static readonly RoutedEvent GotMouseCaptureEvent

Identifies the GotMouseCapture routed event.

public static readonly RoutedEvent LostMouseCaptureEvent

Identifies the LostMouseCapture routed event.

public static readonly RoutedEvent MouseDownEvent

Identifies the MouseDown routed event.

public static readonly RoutedEvent MouseEnterEvent

Identifies the MouseEnter routed event.

public static readonly RoutedEvent MouseLeaveEvent

Identifies the MouseLeave routed event.

public static readonly RoutedEvent MouseMoveEvent

Identifies the MouseMove routed event.

public static readonly RoutedEvent MouseUpEvent

Identifies the MouseUp routed event.

public static readonly RoutedEvent MouseWheelEvent

Identifies the MouseWheel routed event.

public static readonly RoutedEvent PreviewMouseDownEvent

Identifies the PreviewMouseDown routed event.

public static readonly RoutedEvent PreviewMouseMoveEvent

Identifies the PreviewMouseMove routed event.

public static readonly RoutedEvent PreviewMouseUpEvent

Identifies the PreviewMouseUp routed event.

public static readonly RoutedEvent PreviewMouseWheelEvent

Identifies the PreviewMouseWheel routed event.

Static Methods

public static void AddGotMouseCapture(DependencyObject element, MouseEventHandler handler)

 

Parameters

element 
handler 

 

public static void AddLostMouseCapture(DependencyObject element, MouseEventHandler handler)

 

Parameters

element 
handler 

 

public static void AddMouseDownHandler(UIElement element, MouseButtonEventHandler handler)

 

Parameters

element 
handler 

 

public static void AddMouseDownHandler(UIElement element, MouseButtonEventHandler handler, bool handledEventsToo)

 

Parameters

element 
handler 
handledEventsToo 

 

public static void AddMouseEnterHandler(DependencyObject element, MouseEventHandler handler)

 

Parameters

element 
handler 

 

public static void AddMouseLeaveHandler(DependencyObject element, MouseEventHandler handler)

 

Parameters

element 
handler 

 

public static void AddMouseMoveHandler(DependencyObject element, MouseEventHandler handler)

 

Parameters

element 
handler 

 

public static void AddMouseUpHandler(UIElement element, MouseButtonEventHandler handler)

 

Parameters

element 
handler 

 

public static void AddMouseWheelHandler(DependencyObject element, MouseWheelEventHandler handler)

 

Parameters

element 
handler 

 

public static void AddPreviewMouseDownHandler(UIElement element, MouseButtonEventHandler handler)

 

Parameters

element 
handler 

 

public static void AddPreviewMouseMoveHandler(DependencyObject element, MouseEventHandler handler)

 

Parameters

element 
handler 

 

public static void AddPreviewMouseUpHandler(UIElement element, MouseButtonEventHandler handler)

 

Parameters

element 
handler 

 

public static void AddPreviewMouseWheelHandler(DependencyObject element, MouseWheelEventHandler handler)

 

Parameters

element 
handler 

 

public static bool Capture(UIElement element)

 

Parameters

element 

 

public static Point GetPosition(UIElement relativeTo)

 

Parameters

relativeTo 

 

public static void ReleaseCapture(UIElement element)

 

Parameters

element 

 

public static void RemoveGotMouseCapture(DependencyObject element, MouseEventHandler handler)

 

Parameters

element 
handler 

 

public static void RemoveLostMouseCapture(DependencyObject element, MouseEventHandler handler)

 

Parameters

element 
handler 

 

public static void RemoveMouseDownHandler(UIElement element, MouseButtonEventHandler handler)

 

Parameters

element 
handler 

 

public static void RemoveMouseEnterHandler(DependencyObject element, MouseEventHandler handler)

 

Parameters

element 
handler 

 

public static void RemoveMouseLeaveHandler(DependencyObject element, MouseEventHandler handler)

 

Parameters

element 
handler 

 

public static void RemoveMouseMoveHandler(DependencyObject element, MouseEventHandler handler)

 

Parameters

element 
handler 

 

public static void RemoveMouseUpHandler(UIElement element, MouseButtonEventHandler handler)

 

Parameters

element 
handler 

 

public static void RemoveMouseWheelHandler(DependencyObject element, MouseWheelEventHandler handler)

 

Parameters

element 
handler 

 

public static void RemovePreviewMouseDownHandler(UIElement element, MouseButtonEventHandler handler)

 

Parameters

element 
handler 

 

public static void RemovePreviewMouseMoveHandler(DependencyObject element, MouseEventHandler handler)

 

Parameters

element 
handler 

 

public static void RemovePreviewMouseUpHandler(UIElement element, MouseButtonEventHandler handler)

 

Parameters

element 
handler 

 

public static void RemovePreviewMouseWheelHandler(DependencyObject element, MouseWheelEventHandler handler)

 

Parameters

element 
handler 
  • No labels