DoubleTappedRoutedEventArgs Kelas
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Menyediakan data peristiwa untuk peristiwa DoubleTapped .
public ref class DoubleTappedRoutedEventArgs sealed : RoutedEventArgs
/// [Windows.Foundation.Metadata.Activatable(65536, "Microsoft.UI.Xaml.WinUIContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class DoubleTappedRoutedEventArgs final : RoutedEventArgs
[Windows.Foundation.Metadata.Activatable(65536, "Microsoft.UI.Xaml.WinUIContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class DoubleTappedRoutedEventArgs : RoutedEventArgs
Public NotInheritable Class DoubleTappedRoutedEventArgs
Inherits RoutedEventArgs
- Warisan
- Atribut
Contoh
Cuplikan berikut berasal dari Skenario 1 - Peristiwa inputsampel input Dasar.
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_DoubleTapped(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Input::DoubleTappedRoutedEventArgs const&)
{
tapTarget.Background(Windows::UI::Xaml::Media::SolidColorBrush(Windows::UI::Colors::RoyalBlue()));
tapTargetText.Text(L"Double-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_DoubleTapped(Object^ sender, DoubleTappedRoutedEventArgs^ e)
{
tapTarget->Background = ref new SolidColorBrush(Windows::UI::Colors::RoyalBlue);
tapTargetText->Text = "Double-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_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
{
tapTarget.Background = new SolidColorBrush(Windows.UI.Colors.RoyalBlue);
tapTargetText.Text = "Double-Tapped";
}
Keterangan
Peristiwa DoubleTapped dikirim setiap kali mouse diklik ganda atau jari atau pena mengetuk objek dua kali berturut-turut dengan cepat.
Konstruktor
DoubleTappedRoutedEventArgs() |
Menginisialisasi instans baru kelas DoubleTappedRoutedEventArgs . |
Properti
Handled |
Mendapatkan atau menetapkan nilai yang menandai peristiwa yang dirutekan sebagai ditangani. Nilai |
OriginalSource |
Mendapatkan referensi ke objek yang menaikkan peristiwa. Ini sering menjadi bagian templat dari kontrol daripada elemen yang dideklarasikan di antarmuka pengguna aplikasi Anda. (Diperoleh dari RoutedEventArgs) |
PointerDeviceType |
Mendapatkan PointerDeviceType untuk perangkat penunjuk yang memulai peristiwa input terkait. |
Metode
GetPosition(UIElement) |
Mengembalikan koordinat x- dan y dari posisi penunjuk, secara opsional dievaluasi terhadap asal koordinat UIElement yang disediakan. |