Interface IMouseController
IMouseController defines the interface for mouse controllers to be used with MouseControllerDispatcher.
Namespace: Syncfusion.Windows.Controls.Scroll
Assembly: Syncfusion.GridCommon.WPF.dll
Syntax
public interface IMouseController
Remarks
Any mouse controller needs to implement the IMouseController interface.
In its implementation of MouseController.HitTest, the mouse controller should determine whether your controller wants to handle the mouse events based current context.
See MouseControllerDispatcher for further discussion.
Properties
Cursor
Returns the cursor to be displayed.
Declaration
Cursor Cursor { get; }
Property Value
Type |
---|
System.Windows.Input.Cursor |
Name
Returns the name of this mouse controller.
Declaration
string Name { get; }
Property Value
Type |
---|
System.String |
SupportsCancelMouseCapture
Gets a value indicating whether this controller supports the cancel mouse capture feature and the context of the mouse operation can be changed while the user drags the pressed mouse.
Declaration
bool SupportsCancelMouseCapture { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
SupportsMouseTracking
Gets a value indicating whether the controller supports the mouse tracking feature which allows MouseControllerDispatcher to emulate a pressed mouse operation similar to the way a combobox selects the item in a dropped list box while hovering the mouse over the dropped listbox and simulating a MouseUp when the user presses the mouse.
Declaration
bool SupportsMouseTracking { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
CancelMode()
CancelMode is called for the active controller after a MouseDown message when the mouse operation is cancelled.
Declaration
void CancelMode()
HitTest(MouseControllerEventArgs, IMouseController)
HitTest is called to determine whether your controller wants to handle the mouse events based current context.
Declaration
int HitTest(MouseControllerEventArgs mouseEventArgs, IMouseController controller)
Parameters
Type | Name | Description |
---|---|---|
MouseControllerEventArgs | mouseEventArgs | The MouseControllerEventArgs instance containing the event data. |
IMouseController | controller | The controller. |
Returns
Type | Description |
---|---|
System.Int32 | A value not equal to 0 indicates that the controller wants to handle the mouse input; otherwise if equal to 0 the controller is not handling it. |
Remarks
The current winner of the vote is specified through the controller parameter. Your implementation of HitTest can decide if it wants to override the existing vote or leave it.
MouseDown(MouseControllerEventArgs)
MouseDown is called when this controller signaled in HitTest that it wants to handle mouse events and the user pressed the mouse button.
Declaration
void MouseDown(MouseControllerEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseControllerEventArgs | e | The MouseControllerEventArgs instance containing the event data. |
Remarks
MouseDown is called and this controller will become the active controller and receive all subsequent mouse messages until the mouse button is released or the mouse operation is cancelled.
MouseHover(MouseControllerEventArgs)
MouseHover is called when this controller signaled in HitTest that it wants to handle mouse events. MouseHover is called after MouseHoverEnter.
Declaration
void MouseHover(MouseControllerEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseControllerEventArgs | e | The MouseControllerEventArgs instance containing the event data. |
MouseHoverEnter(MouseEventArgs)
MouseHoverEnter is called when this controller signaled in HitTest that it wants to handle mouse events. MouseHoverEnter is called before the MouseHover is called for the first time.
Declaration
void MouseHoverEnter(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseEventArgs | e | The System.Windows.Input.MouseEventArgs instance containing the event data. |
MouseHoverLeave(MouseEventArgs)
MouseHoverLeave is called when hovering ends either because user dragged mouse out of the hit-test area or when context changes (e.g. user pressed the mouse button).
Declaration
void MouseHoverLeave(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseEventArgs | e | The System.Windows.Input.MouseEventArgs instance containing the event data. |
MouseMove(MouseControllerEventArgs)
MouseMove is called for the active controller after a MouseDown message when the user moves the mouse pointer.
Declaration
void MouseMove(MouseControllerEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseControllerEventArgs | e | The MouseControllerEventArgs instance containing the event data. |
MouseUp(MouseControllerEventArgs)
MouseUp is called for the active controller after a MouseDown message when the user releases the mouse button.
Declaration
void MouseUp(MouseControllerEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseControllerEventArgs | e | The MouseControllerEventArgs instance containing the event data. |
RestoreMode()
RestoreMode is called when a controller should be reactivated. Prevoius state can be restored if it was backed up earlier when CancelMode was called.
Declaration
void RestoreMode()