DoubleTappedRoutedEventArgs DoubleTappedRoutedEventArgs DoubleTappedRoutedEventArgs DoubleTappedRoutedEventArgs Class


Provides event data for the DoubleTapped event.

public : sealed class DoubleTappedRoutedEventArgs : RoutedEventArgs, IDoubleTappedRoutedEventArgs
struct winrt::Windows::UI::Xaml::Input::DoubleTappedRoutedEventArgs : RoutedEventArgs, IDoubleTappedRoutedEventArgs
public sealed class DoubleTappedRoutedEventArgs : RoutedEventArgs, IDoubleTappedRoutedEventArgs
Public NotInheritable Class DoubleTappedRoutedEventArgs Inherits RoutedEventArgs Implements IDoubleTappedRoutedEventArgs
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


The following code example shows scenario 3 from the Input sample. This code shows some usage patterns for direct manipulation using the Holding, Tapped, DoubleTapped, and RightTapped events.

  <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
    <Button x:Name="scenario3Reset" Content="Reset" Margin="0,0,10,0" 
      Click="Scenario3Reset" />
  <StackPanel Orientation="Horizontal">
    <Border x:Name="bTapped" Background="Red" 
      Height="100" Width="150" CornerRadius="20" Margin="20" 
      BorderBrush="Black" BorderThickness="2">
      <TextBlock Style="{StaticResource BasicTextStyle}" Text="Tap" 
        HorizontalAlignment="Center" VerticalAlignment="Center"/>
    <Border x:Name="bDoubleTapped" Background="Red" 
      Height="100" Width="150" CornerRadius="20" Margin="20" 
      BorderBrush="Black" BorderThickness="2">
      <TextBlock Style="{StaticResource BasicTextStyle}" 
        Text="Double Tap" 
        HorizontalAlignment="Center" VerticalAlignment="Center"/>
    <Border x:Name="bRightTapped" Background="Red" 
      Height="100" Width="150" CornerRadius="20" Margin="20" 
      BorderBrush="Black" BorderThickness="2">
      <TextBlock Style="{StaticResource BasicTextStyle}" 
        Text="Press, Hold and Lift" TextWrapping="Wrap" 
        HorizontalAlignment="Center" VerticalAlignment="Center"/>
    <Border x:Name="bHolding" Background="Red" 
      Height="100" Width="150" CornerRadius="20" Margin="20" 
      BorderBrush="Black" BorderThickness="2">
      <TextBlock Style="{StaticResource BasicTextStyle}" Text="Hold" 
        HorizontalAlignment="Center" VerticalAlignment="Center"/>
public Scenario3()
    bTapped.Tapped += new TappedEventHandler(bTapped_Tapped);
    bDoubleTapped.DoubleTapped += new DoubleTappedEventHandler(
    bRightTapped.RightTapped += new RightTappedEventHandler(
    bHolding.Holding += new HoldingEventHandler(bHolding_Holding);

private void Scenario3UpdateVisuals(Border border, String gesture)
    switch (gesture.ToLower())
        case "holding":
            border.Background = new SolidColorBrush(Colors.Yellow);
            border.Background = new SolidColorBrush(Colors.Green);

    ((TextBlock)border.Child).Text = gesture;

private void bHolding_Holding(object sender, HoldingRoutedEventArgs e)
    string holdingState = 
        (e.HoldingState == Windows.UI.Input.HoldingState.Started) ? 
        "Holding" : "Held";
    Scenario3UpdateVisuals(sender as Border, holdingState);

private void bDoubleTapped_DoubleTapped(object sender, 
    DoubleTappedRoutedEventArgs e)
    Scenario3UpdateVisuals(sender as Border, "Double Tapped");

private void bRightTapped_RightTapped(object sender, 
    RightTappedRoutedEventArgs e)
    Scenario3UpdateVisuals(sender as Border, "Right Tapped");

private void bTapped_Tapped(object sender, TappedRoutedEventArgs e)
    Scenario3UpdateVisuals(sender as Border, "Tapped");

private void Scenario3Reset(object sender, RoutedEventArgs e)

private void Scenario3Reset()
    bTapped.Background = new SolidColorBrush(Colors.Red);
    bHolding.Background = new SolidColorBrush(Colors.Red);
    bDoubleTapped.Background = new SolidColorBrush(Colors.Red);
    bRightTapped.Background = new SolidColorBrush(Colors.Red);
Public Sub New()
    AddHandler bTapped.Tapped, AddressOf bTapped_Tapped
    AddHandler bDoubleTapped.DoubleTapped, AddressOf bDoubleTapped_DoubleTapped
    AddHandler bRightTapped.RightTapped, AddressOf bRightTapped_RightTapped
    AddHandler bHolding.Holding, AddressOf bHolding_Holding
End Sub

''' <summary>
''' Invoked when this page is about to be displayed in a Frame.
''' </summary>
''' <param name="e">Event data that describes how this page was reached.  The Parameter
''' property is typically used to configure the page.</param>
Protected Overrides Sub OnNavigatedTo(e As NavigationEventArgs)
End Sub

Private Sub Scenario3UpdateVisuals(border As Border, gesture As String)
    Select Case gesture.ToLower()
        Case "holding"
            border.Background = New SolidColorBrush(Colors.Yellow)
            Exit Select
        Case Else
            border.Background = New SolidColorBrush(Colors.Green)
            Exit Select
    End Select

    DirectCast(border.Child, TextBlock).Text = gesture
End Sub

Private Sub bHolding_Holding(sender As Object, e As HoldingRoutedEventArgs)
    Dim holdingState As String = If((e.HoldingState = Windows.UI.Input.HoldingState.Started), "Holding", "Held")
    Scenario3UpdateVisuals(TryCast(sender, Border), holdingState)
End Sub

Private Sub bDoubleTapped_DoubleTapped(sender As Object, e As DoubleTappedRoutedEventArgs)
    Scenario3UpdateVisuals(TryCast(sender, Border), "Double Tapped")
End Sub
Private Sub bRightTapped_RightTapped(sender As Object, e As RightTappedRoutedEventArgs)
    Scenario3UpdateVisuals(TryCast(sender, Border), "Right Tapped")
End Sub
Private Sub bTapped_Tapped(sender As Object, e As TappedRoutedEventArgs)
    Scenario3UpdateVisuals(TryCast(sender, Border), "Tapped")
End Sub

Private Sub Scenario3ResetMethod(sender As Object, e As RoutedEventArgs)
End Sub

Private Sub Reset()
    bTapped.Background = New SolidColorBrush(Colors.Red)
    bHolding.Background = New SolidColorBrush(Colors.Red)
    bDoubleTapped.Background = New SolidColorBrush(Colors.Red)
End Sub


DoubleTappedRoutedEventArgs() DoubleTappedRoutedEventArgs() DoubleTappedRoutedEventArgs() DoubleTappedRoutedEventArgs()

Initializes a new instance of the DoubleTappedRoutedEventArgs class.

public : DoubleTappedRoutedEventArgs()
DoubleTappedRoutedEventArgs() const;
public DoubleTappedRoutedEventArgs()
Public Sub New()


Handled Handled Handled Handled

Gets or sets a value that marks the routed event as handled. A true value for Handled prevents most handlers along the event route from handling the same event again.

public : Platform::Boolean Handled { get; set; }
bool Handled(); void Handled(bool handled);
public bool Handled { get; set; }
Public ReadWrite Property Handled As bool
bool bool

true to mark the routed event handled. false to leave the routed event unhandled, which permits the event to potentially route further and be acted on by other handlers. The default is false.

See Also

OriginalSource OriginalSource OriginalSource OriginalSource

Gets a reference to the object that raised the event. This is often a template part of a control rather than an element that was declared in your app UI.

(Inherited from RoutedEventArgs)

PointerDeviceType PointerDeviceType PointerDeviceType PointerDeviceType

Gets the PointerDeviceType for the pointer device that initiated the associated input event.

public : PointerDeviceType PointerDeviceType { get; }
PointerDeviceType PointerDeviceType();
public PointerDeviceType PointerDeviceType { get; }
Public ReadOnly Property PointerDeviceType As PointerDeviceType
PointerDeviceType PointerDeviceType

The PointerDeviceType for this event occurrence.


GetPosition(UIElement) GetPosition(UIElement) GetPosition(UIElement) GetPosition(UIElement)

Returns the x- and y-coordinates of the pointer position, optionally evaluated against a coordinate origin of a supplied UIElement.

public : Point GetPosition(UIElement relativeTo)
Point GetPosition(UIElement relativeTo) const;
public Point GetPosition(UIElement relativeTo)
Public Function GetPosition(relativeTo As UIElement) As Point
UIElement UIElement

Any UIElement -derived object that is connected to the same object tree. To specify the object relative to the overall coordinate system, use a relativeTo value of null.


A Point that represents the current x- and y-coordinates of the mouse pointer position. If null was passed as relativeTo, this coordinate is for the overall window. If a relativeTo value other than null was passed, this coordinate is relative to the object referenced by relativeTo.

See Also

See Also

  • Windows.UI.Xaml.RoutedEventArgs ndows.ui.xaml/