Extends ComponentBehavior to provide comprehensive input handling capabilities including mouse, keyboard, and gesture input processing for RadControl components.
ComponentInputBehavior specializes in managing all forms of user input for RadControl instances, building upon the base ComponentBehavior functionality. It handles mouse events (clicks, movement, hovering), keyboard input, touch gestures, and coordinates these inputs with the RadElement tree to provide proper event routing and state management.
Key responsibilities include:
- Mouse event routing and element hit testing
- Element selection and pressed state management
- Mouse capture and release handling
- Hover detection and element monitoring
- Keyboard input processing and routing
- Touch and gesture input handling
- Input state coordination across the element hierarchy
The class maintains various input-related states such as which elements are hovered, pressed, or have captured mouse input, ensuring proper visual feedback and interaction behavior throughout the control's element tree.
Definition
Namespace:Telerik.WinControls
Assembly:Telerik.WinControls.dll
Syntax:
public class ComponentInputBehavior : ComponentBehavior, IDisposable
Inheritance: objectComponentBehaviorComponentInputBehavior
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the ComponentInputBehavior class for the specified component tree handler.
public ComponentInputBehavior(IComponentTreeHandler owner)
The IComponentTreeHandler that owns this input behavior instance.
The constructor calls the base ComponentBehavior constructor and initializes input-specific settings. By default, it enables item tooltips based on the ShowItemToolTips setting.
This constructor establishes the input handling system for the component, preparing it to process mouse, keyboard, and gesture input events and route them appropriately through the element tree.
Properties
Gets or sets a value indicating whether input processing is enabled for this component.
[Browsable(false)]
public bool Enable { get; set; }
true if input events should be processed; otherwise, false. The default is true.
When this property is set to
false, the component will not process mouse, keyboard, or other input events. This can be useful for temporarily disabling interaction during certain operations or states.
Gets the mouse hover timer used to detect and handle mouse hover events.
protected MouseHoverTimer MouseHoverTimer { get; }
A MouseHoverTimer instance used for hover detection and timing.
This timer is used internally to manage mouse hover detection, determining when the mouse has remained stationary over an element long enough to trigger hover-related events and visual feedback such as tooltips.
Methods
Releases managed resources and references owned by this behavior.
Gets the uppermost element in the current hover chain, preferring a non-box element when available.
public RadElement GetHoveredRadElement()
The selected hovered element, or null when no hover chain is tracked.
Clears the previous hover selection while preserving parent-notified input when the new element is nested beneath it.
protected void HandleMouseLeave(EventArgs e, RadElement elementUnderMouse)
The mouse event that caused the selection to change.
elementUnderMouseRadElementThe newly hit-tested element, if any.
Clears the current hover selection when the pointer leaves without another hit-tested element.
Raises HoveredElementChanged when the uppermost hovered element changes.
protected virtual void OnHoveredElementChanged(HoveredElementChangedEventArgs e)
The new uppermost hovered element.
Clears the captured-item reference, notifies the captured item, and forwards the notification to the owner.
public virtual void OnMouseCaptureChanged(EventArgs e)
The mouse-capture event data.
Selects or uses the captured element, sends it mouse-down, and resets active key tips.
public virtual bool OnMouseDown(MouseEventArgs e)
The mouse-down event data.
Returns:false so the control continues its standard event processing.
Updates the hovered element or routes movement to the captured item, including enter/leave transitions while captured.
public virtual bool OnMouseMove(MouseEventArgs e)
The mouse-move event data.
Returns:false so the control continues its standard event processing.
Routes mouse-up to the captured item, selected element, or hit-tested element when mouse input is enabled.
public virtual bool OnMouseUp(MouseEventArgs e)
The mouse-up event data.
Returns:false so the control continues its standard event processing.
Routes the wheel event to the focused element, or to the selected element when none is focused.
public virtual bool OnMouseWheel(MouseEventArgs e)
The mouse-wheel event data.
Returns:false so the control continues its standard event processing.
Events
Fires when hovered element is changed.
public event HoveredElementChangedEventHandler HoveredElementChanged