Class
Mouse

Represents the mouse device.

Definition

Namespace:Telerik.UI.Xaml.Controls

Assembly:Telerik.WinUI.Controls.dll

Syntax:

cs-api-definition
public static class Mouse

Inheritance: objectMouse

Fields

MouseDownEvent

Occurs when the right mouse button is pressed.

Declaration

cs-api-definition
public static readonly RoutedEvent MouseDownEvent

Field Value

RoutedEvent

MouseUpEvent

Occurs when the right mouse button is released.

Declaration

cs-api-definition
public static readonly RoutedEvent MouseUpEvent

Field Value

RoutedEvent

MouseWheelEvent

Occurs when the mouse wheel is rotated.

Declaration

cs-api-definition
public static readonly RoutedEvent MouseWheelEvent

Field Value

RoutedEvent

Properties

ClickVicinity

A static property of type double that gets or sets the maximum distance a click point can move for the action to be considered a DoubleClick. The distance is measured in pixels. The default value is 5.

Declaration

cs-api-definition
public static double ClickVicinity { get; set; }

Property Value

double

DoubleClickDuration

Gets or sets the value determining the duration between two clicks that are considered as a double click.

Declaration

cs-api-definition
public static TimeSpan DoubleClickDuration { get; set; }

Property Value

TimeSpan

Methods

AddMouseDownHandler(UIElement, EventHandler<MouseButtonEventArgs>)

Adds a handler for the MouseDown attached event.

Declaration

cs-api-definition
public static void AddMouseDownHandler(UIElement element, EventHandler<MouseButtonEventArgs> handler)

Parameters

element

UIElement

The UIElement that listens to this event.

handler

EventHandler<MouseButtonEventArgs>

The event handler.

AddMouseDownHandler(UIElement, EventHandler<MouseButtonEventArgs>, bool)

Adds a handler for the MouseDown attached event.

Declaration

cs-api-definition
public static void AddMouseDownHandler(UIElement element, EventHandler<MouseButtonEventArgs> handler, bool handledEventsToo)

Parameters

element

UIElement

The UIElement that listens to this event.

handler

EventHandler<MouseButtonEventArgs>

The event handler.

handledEventsToo

bool

True to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled.

AddMouseUpHandler(UIElement, EventHandler<MouseButtonEventArgs>)

Adds a handler for the MouseUp attached event.

Declaration

cs-api-definition
public static void AddMouseUpHandler(UIElement element, EventHandler<MouseButtonEventArgs> handler)

Parameters

element

UIElement

The UIElement that listens to this event.

handler

EventHandler<MouseButtonEventArgs>

The event handler.

AddMouseUpHandler(UIElement, EventHandler<MouseButtonEventArgs>, bool)

Adds a handler for the MouseUp attached event.

Declaration

cs-api-definition
public static void AddMouseUpHandler(UIElement element, EventHandler<MouseButtonEventArgs> handler, bool handledEventsToo)

Parameters

element

UIElement

The UIElement that listens to this event.

handler

EventHandler<MouseButtonEventArgs>

The event handler.

handledEventsToo

bool

True to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled.

AddMouseWheelHandler(DependencyObject, EventHandler<MouseWheelEventArgs>)

Adds a handler for the MouseWheel attached event.

Declaration

cs-api-definition
public static void AddMouseWheelHandler(DependencyObject element, EventHandler<MouseWheelEventArgs> handler)

Parameters

element

DependencyObject

The UIElement that listens to this event.

handler

EventHandler<MouseWheelEventArgs>

The event handler.

RemoveMouseDownHandler(UIElement, EventHandler<MouseButtonEventArgs>)

Removes a handler for the MouseDown attached event.

Declaration

cs-api-definition
public static void RemoveMouseDownHandler(UIElement element, EventHandler<MouseButtonEventArgs> handler)

Parameters

element

UIElement

The UIElement that listens to this event.

handler

EventHandler<MouseButtonEventArgs>

The event handler.

RemoveMouseUpHandler(UIElement, EventHandler<MouseButtonEventArgs>)

Removes a handler for the MouseUp attached event.

Declaration

cs-api-definition
public static void RemoveMouseUpHandler(UIElement element, EventHandler<MouseButtonEventArgs> handler)

Parameters

element

UIElement

The UIElement that listens to this event.

handler

EventHandler<MouseButtonEventArgs>

The event handler.

RemoveMouseWheelHandler(DependencyObject, EventHandler<MouseWheelEventArgs>)

Removes a handler for the MouseWheel attached event.

Declaration

cs-api-definition
public static void RemoveMouseWheelHandler(DependencyObject element, EventHandler<MouseWheelEventArgs> handler)

Parameters

element

DependencyObject

The UIElement that listens to this event.

handler

EventHandler<MouseWheelEventArgs>

The event handler.