EdgeGesture EdgeGesture EdgeGesture EdgeGesture Class

Provides access to the events that notify an app of triggers to its edge-based UI.

Syntax

Declaration

public sealed class EdgeGesturepublic sealed class EdgeGesturePublic NotInheritable Class EdgeGesturepublic sealed class EdgeGesture

Remarks

Note

: This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX) and Using Windows Runtime objects in a multithreaded environment (.NET).

Examples

The following example demonstrates the use of GetForCurrentView() to retrieve an instance EdgeGesture through which it then registers for each of the edge gesture events.


var edgeGesture = Windows.UI.Input.EdgeGesture.getForCurrentView();
edgeGesture.addEventListener("starting", onStarting);
edgeGesture.addEventListener("completed", onCompleted);
edgeGesture.addEventListener("canceled", onCanceled);

Methods summary

Gets an instance of the EdgeGesture class that is used to add and remove event delegate handlers for the current view.

Events summary

Fires when a user cancels a show or hide action for an edge-based UI.

Fires to indicate that the user has successfully summoned or dismissed the edge-based UI. This occurs either when the user lifts his or her finger from a touch-enabled screen or when the user presses Win+Z on the keyboard.

Fires when a user begins an action to summon or dismiss edge-based UI.

Methods

  • GetForCurrentView()
    GetForCurrentView()
    GetForCurrentView()
    GetForCurrentView()

    Gets an instance of the EdgeGesture class that is used to add and remove event delegate handlers for the current view.

    public static EdgeGesture GetForCurrentView()public static EdgeGesture GetForCurrentView()Public Static Function GetForCurrentView() As EdgeGesturepublic static EdgeGesture GetForCurrentView()

    Returns

    Remarks

    This method uses the current CoreWindow of your application's CoreApplication object to determine the particular instance. That is, there is a 1:1 correspondence between different instances of EdgeGesture and CoreWindow. You cannot obtain an instance of an EdgeGesture class for another app, nor can an EdgeGesture instance be obtained for an app without a current CoreWindow.

Events

  • Canceled
    Canceled
    Canceled
    Canceled

    Fires when a user cancels a show or hide action for an edge-based UI.

    public event TypedEventHandler Canceledpublic event TypedEventHandler CanceledPublic Event Canceledpublic event TypedEventHandler Canceled

    Remarks

    This event occurs only with touch input; the user either moves their finger back to the interaction's starting position and lifts, or continues to drag their finger into the middle of the screen. This event is always preceded by a Starting event.

    Cancelling the action causes the UI that is being summoned or dismissed to animate back to the state that it was in before the Starting event.

  • Completed
    Completed
    Completed
    Completed

    Fires to indicate that the user has successfully summoned or dismissed the edge-based UI. This occurs either when the user lifts his or her finger from a touch-enabled screen or when the user presses Win+Z on the keyboard.

    public event TypedEventHandler Completedpublic event TypedEventHandler CompletedPublic Event Completedpublic event TypedEventHandler Completed

    Remarks

    This event occurs as a result of either touch or keyboard input. In the case of keyboard input (Win+Z), this is the only event that fires. In the case of touch input, it occurs when the user lifts his or her finger at the end of the swipe and is preceded by the Starting event.

    When the handler for this event is called, an app can do one of two things: show its edge-based UI if that UI isn't currently shown, or hide the UI if it is shown.

  • Starting
    Starting
    Starting
    Starting

    Fires when a user begins an action to summon or dismiss edge-based UI.

    public event TypedEventHandler Startingpublic event TypedEventHandler StartingPublic Event Startingpublic event TypedEventHandler Starting

    Remarks

    This event occurs only with a touch interaction. A keyboard invocation of edge-based UI does not include this event. The Starting event is always followed by either a Completed or a Canceled event.

    When the handler for this event is called, an app could be called to do one of two things, barring a cancellation of the operation: show its edge-based UI if that UI isn't currently shown or hide the UI if it is shown.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.MuseAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ThreadingAttribute

Details

Assembly

Windows.UI.Input.dll