Condividi tramite


RightTappedRoutedEventArgs Classe

Definizione

Fornisce i dati dell'evento RightTapped .

public ref class RightTappedRoutedEventArgs sealed : RoutedEventArgs
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class RightTappedRoutedEventArgs final : RoutedEventArgs
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class RightTappedRoutedEventArgs final : RoutedEventArgs
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class RightTappedRoutedEventArgs : RoutedEventArgs
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class RightTappedRoutedEventArgs : RoutedEventArgs
Public NotInheritable Class RightTappedRoutedEventArgs
Inherits RoutedEventArgs
Ereditarietà
Object Platform::Object IInspectable RoutedEventArgs RightTappedRoutedEventArgs
Attributi

Requisiti Windows

Famiglia di dispositivi
Windows 10 (è stato introdotto in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (è stato introdotto in v1.0)

Esempio

I frammenti di codice seguenti provengono dallo Scenario 1 - Eventi di inputdell'esempio di input di base.

Scenario1::Scenario1()
{
    InitializeComponent();

    // pointer press/release handlers
    pressedTarget.PointerPressed(this, &Scenario1::target_PointerPressed);
    pressedTarget.PointerReleased(this, &Scenario1::target_PointerReleased);

    // pointer enter/exit handlers
    enterExitTarget.PointerEntered(this, &Scenario1::target_PointerEntered);
    enterExitTarget.PointerExited(this, &Scenario1::target_PointerExited);

    // gesture handlers
    tapTarget.Tapped(this, &Scenario1::target_Tapped);
    tapTarget.DoubleTapped(this, &Scenario1::target_DoubleTapped);

    holdTarget.Holding(this, &Scenario1::target_Holding);
    holdTarget.RightTapped(this, &Scenario1::target_RightTapped);
}

void Scenario1::target_RightTapped(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Input::RightTappedRoutedEventArgs const& args)
{
    holdTarget.Background(Windows::UI::Xaml::Media::SolidColorBrush(Windows::UI::Colors::RoyalBlue()));
    holdTargetText.Text(L"Right-Tapped");
}
Scenario1::Scenario1()
{
    InitializeComponent();

    // pointer press/release handlers
    pressedTarget->PointerPressed += ref new PointerEventHandler(this, &Scenario1::target_PointerPressed);
    pressedTarget->PointerReleased += ref new PointerEventHandler(this, &Scenario1::target_PointerReleased);

    // pointer enter/exit handlers
    enterExitTarget->PointerEntered += ref new PointerEventHandler(this, &Scenario1::target_PointerEntered);
    enterExitTarget->PointerExited += ref new PointerEventHandler(this, &Scenario1::target_PointerExited);

    // gesture handlers
    tapTarget->Tapped += ref new TappedEventHandler(this, &Scenario1::target_Tapped);
    tapTarget->DoubleTapped += ref new DoubleTappedEventHandler(this, &Scenario1::target_DoubleTapped);

    holdTarget->Holding += ref new HoldingEventHandler(this, &Scenario1::target_Holding);
    holdTarget->RightTapped += ref new RightTappedEventHandler(this, &Scenario1::target_RightTapped);
}

void Scenario1::target_RightTapped(Object^ sender, RightTappedRoutedEventArgs^ e)
{
    holdTarget->Background = ref new SolidColorBrush(Windows::UI::Colors::RoyalBlue);
    holdTargetText->Text = "Right Tapped";
}
public Scenario1()
{
    this.InitializeComponent();

    // pointer press/release handlers
    pressedTarget.PointerPressed += new PointerEventHandler(target_PointerPressed);
    pressedTarget.PointerReleased += new PointerEventHandler(target_PointerReleased);

    // pointer enter/exit handlers
    enterExitTarget.PointerEntered += new PointerEventHandler(target_PointerEntered);
    enterExitTarget.PointerExited += new PointerEventHandler(target_PointerExited);

    // gesture handlers
    tapTarget.Tapped += new TappedEventHandler(target_Tapped);
    tapTarget.DoubleTapped += new DoubleTappedEventHandler(target_DoubleTapped);
    holdTarget.Holding += new HoldingEventHandler(target_Holding);
    holdTarget.RightTapped += new RightTappedEventHandler(target_RightTapped);
}

void target_RightTapped(object sender, RightTappedRoutedEventArgs e)
{
    holdTarget.Background = new SolidColorBrush(Windows.UI.Colors.RoyalBlue);
    holdTargetText.Text = "Right Tapped";
}
Public Sub New()
    Me.InitializeComponent()
    AddHandler pressedTarget.PointerPressed, New PointerEventHandler(AddressOf target_PointerPressed)
    AddHandler pressedTarget.PointerReleased, New PointerEventHandler(AddressOf target_PointerReleased)
    AddHandler enterExitTarget.PointerEntered, New PointerEventHandler(AddressOf target_PointerEntered)
    AddHandler enterExitTarget.PointerExited, New PointerEventHandler(AddressOf target_PointerExited)
    AddHandler tapTarget.Tapped, New TappedEventHandler(AddressOf target_Tapped)
    AddHandler tapTarget.DoubleTapped, New DoubleTappedEventHandler(AddressOf target_DoubleTapped)
    AddHandler holdTarget.Holding, New HoldingEventHandler(AddressOf target_Holding)
    AddHandler holdTarget.RightTapped, New RightTappedEventHandler(AddressOf target_RightTapped)
End Sub

Sub target_RightTapped(sender As Object, e As RightTappedRoutedEventArgs)
    holdTarget.Background = New SolidColorBrush(Windows.UI.Colors.RoyalBlue)
    holdTargetText.Text = "Right Tapped"
End Sub

Commenti

Un evento RightTapped viene inviato ogni volta che viene fatto clic con il pulsante destro del mouse o un dito, una penna o un dispositivo puntatore simile completa un evento Holding ed è destinato alla gestione di azioni secondarie su un oggetto.

Costruttori

RightTappedRoutedEventArgs()

Inizializza una nuova istanza della classe RightTappedRoutedEventArgs .

Proprietà

Handled

Ottiene o imposta un valore che contrassegna l'evento indirizzato come gestito. Un valore true per Handled impedisce alla maggior parte dei gestori lungo la route di eventi di gestire nuovamente lo stesso evento.

OriginalSource

Ottiene un riferimento all'oggetto che ha generato l'evento. Si tratta spesso di una parte di modello di un controllo anziché di un elemento dichiarato nell'interfaccia utente dell'app.

(Ereditato da RoutedEventArgs)
PointerDeviceType

Ottiene pointerDeviceType per il dispositivo puntatore che ha avviato l'evento di input associato.

Metodi

GetPosition(UIElement)

Restituisce le coordinate x e y della posizione del puntatore, valutate facoltativamente rispetto a un'origine coordinata di un OGGETTO UIElement fornito.

Si applica a

Vedi anche