menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Interface ICaptureContext - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Interface ICaptureContext

    This interface is used by MouseControllerDispatcher to support interaction with UIElements that grab mouse capture. When a mouse was pressed and a control grabs the mouse capture the MouseControllerDispatcher creates a capture context to allow the mouse to interact with the UIElement while inside the context but also to switch back to another context when the user drags the mouse out of the UIElement.

    An example scenerio is selection of cells inside a grid. While inside a textbox you can select text but when dragging the mouse outside the grid switches to selecting cells. When dragging the mouse back inside the textbox, the textbox gets the mouse capture again and you switch back to selecting text inside the cell.

    Namespace: Syncfusion.Windows.Controls.Scroll
    Assembly: Syncfusion.GridCommon.WPF.dll
    Syntax
    public interface ICaptureContext

    Methods

    CancelMouseCapture()

    Cancel the mouse capture.

    Declaration
    bool CancelMouseCapture()
    Returns
    Type Description
    System.Boolean

    true if capture can be cancelled; false if context should not be changed.

    PointInContext(Point)

    Determines if the points belongs to the same element that this context was crreated for.

    Declaration
    bool PointInContext(Point mousePosition)
    Parameters
    Type Name Description
    System.Windows.Point mousePosition

    The mouse position.

    Returns
    Type
    System.Boolean

    RecaptureMouse()

    Recaptures the mouse if the capture was taken away earlier because the user moved the mouse away from the UIElement and now has moved the mouse back into the UIElement.

    Declaration
    Point RecaptureMouse()
    Returns
    Type
    System.Windows.Point
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved