RightTappedRoutedEventArgs class

Applies to Windows and Windows Phone

Provides event data for the RightTapped event.

Inheritance

Object
  RoutedEventArgs
    RightTappedRoutedEventArgs

Syntax


Public NotInheritable Class RightTappedRoutedEventArgs
    Inherits RoutedEventArgs

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

Members

The RightTappedRoutedEventArgs class has these types of members:

Constructors

The RightTappedRoutedEventArgs class has these constructors.

ConstructorDescription
RightTappedRoutedEventArgs Initializes a new instance of the RightTappedRoutedEventArgs class.

 

Methods

The RightTappedRoutedEventArgs class has these methods. It also inherits methods from the Object class.

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

 

Properties

The RightTappedRoutedEventArgs class has these properties.

PropertyAccess typeDescription

Handled

Read/writeGets 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.

OriginalSource

Read-onlyGets a reference to the object that raised the event. (Inherited from RoutedEventArgs)

PointerDeviceType

Read-onlyGets the PointerDeviceType for the pointer device that initiated the associated input event.

 

Examples

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>
  <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
    <Button x:Name="scenario3Reset" Content="Reset" Margin="0,0,10,0" 
      Click="Scenario3Reset" />
  </StackPanel>
  <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>
    <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>
    <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>
    <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"/>
    </Border>
  </StackPanel>
</StackPanel>



Public Sub New()
    Me.InitializeComponent()
    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)
    Reset()
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


Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Input
Windows::UI::Xaml::Input [C++]

Metadata

Windows.winmd

See also

RoutedEventArgs

 

 

Show:
© 2014 Microsoft