다음을 통해 공유


HoldingRoutedEventArgs 클래스

정의

Holding 이벤트에 대한 이벤트 데이터를 제공합니다.

public ref class HoldingRoutedEventArgs 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 HoldingRoutedEventArgs 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 HoldingRoutedEventArgs 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 HoldingRoutedEventArgs : 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 HoldingRoutedEventArgs : RoutedEventArgs
Public NotInheritable Class HoldingRoutedEventArgs
Inherits RoutedEventArgs
상속
Object Platform::Object IInspectable RoutedEventArgs HoldingRoutedEventArgs
특성

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)

예제

다음 코드 조각은 시나리오 1 -기본 입력 샘플의 입력 이벤트에서 가져옵니다.

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_Holding(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::Input::HoldingRoutedEventArgs const& args)
{
    if (args.HoldingState() == Windows::UI::Input::HoldingState::Started)
    {
        holdTarget.Background(Windows::UI::Xaml::Media::SolidColorBrush(Windows::UI::Colors::DeepSkyBlue()));
        holdTargetText.Text(L"Holding");
    }
    else if (args.HoldingState() == Windows::UI::Input::HoldingState::Completed)
    {
        holdTarget.Background(Windows::UI::Xaml::Media::SolidColorBrush(Windows::UI::Colors::LightGray()));
        holdTargetText.Text(L"Held");
    }
    else
    {
        holdTarget.Background(Windows::UI::Xaml::Media::SolidColorBrush(Windows::UI::Colors::LightGray()));
        holdTargetText.Text(L"Hold Canceled");
    }
}
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_Holding(Object^ sender, HoldingRoutedEventArgs^ e)
{
    if (e->HoldingState == Windows::UI::Input::HoldingState::Started)
    {
        holdTarget->Background = ref new SolidColorBrush(Windows::UI::Colors::DeepSkyBlue);
        holdTargetText->Text = "Holding";
    }
    else if (e->HoldingState == Windows::UI::Input::HoldingState::Completed)
    {
        holdTarget->Background = ref new SolidColorBrush(Windows::UI::Colors::LightGray);
        holdTargetText->Text = "Held";
    }
    else
    {
        holdTarget->Background = ref new SolidColorBrush(Windows::UI::Colors::LightGray);
        holdTargetText->Text = "Hold Canceled";
    }
}
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_Holding(object sender, HoldingRoutedEventArgs e)
{
    if (e.HoldingState == Windows.UI.Input.HoldingState.Started)
    {
        holdTarget.Background = new SolidColorBrush(Windows.UI.Colors.DeepSkyBlue);
        holdTargetText.Text = "Holding";
    }
    else if (e.HoldingState == Windows.UI.Input.HoldingState.Completed)
    {
        holdTarget.Background = new SolidColorBrush(Windows.UI.Colors.LightGray);
        holdTargetText.Text = "Held";
    }
    else
    {
        holdTarget.Background = new SolidColorBrush(Windows.UI.Colors.LightGray);
        holdTargetText.Text = "Hold Canceled";
    }
}
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_Holding(sender As Object, e As HoldingRoutedEventArgs)
    If e.HoldingState = Windows.UI.Input.HoldingState.Started Then
        holdTarget.Background = New SolidColorBrush(Windows.UI.Colors.DeepSkyBlue)
        holdTargetText.Text = "Holding"
    ElseIf e.HoldingState = Windows.UI.Input.HoldingState.Completed Then
        holdTarget.Background = New SolidColorBrush(Windows.UI.Colors.LightGray)
        holdTargetText.Text = "Held"
    Else
        holdTarget.Background = New SolidColorBrush(Windows.UI.Colors.LightGray)
        holdTargetText.Text = "Hold Canceled"
    End If
End Sub

설명

홀딩 이벤트는 손가락, 펜 또는 이와 유사한 포인팅 장치를 누르고 개체에 보관할 때마다 전송됩니다.

짧은 시간 임계값이 경과하면 이벤트는 Started 형식의 HoldingState와 함께 전송됩니다.

디바이스가 해제되면(Holding 이벤트 후) 다른 Holding 이벤트가 Completed 형식의 HoldingState와 함께 전송됩니다.

사용자가 보류를 시작한 후 취소하지만 완료하기 전에 HoldingState 형식의 Canceled 형식으로 홀 이벤트가 전송됩니다.

생성자

HoldingRoutedEventArgs()

HoldingRoutedEventArgs 클래스의 새 instance 초기화합니다.

속성

Handled

라우트된 이벤트를 처리됨으로 표시하는 값을 가져오거나 설정합니다. Handledtrue 값은 이벤트 경로를 따라 있는 대부분의 처리기가 동일한 이벤트를 다시 처리하지 못하도록 합니다.

HoldingState

상호 작용에 대한 기본 HoldingState 를 가져옵니다.

OriginalSource

이벤트를 발생시킨 개체에 대한 참조를 가져옵니다. 앱 UI에서 선언된 요소가 아닌 컨트롤의 템플릿 부분입니다.

(다음에서 상속됨 RoutedEventArgs)
PointerDeviceType

연결된 입력 이벤트를 시작한 포인터 디바이스에 대한 PointerDeviceType 을 가져옵니다.

메서드

GetPosition(UIElement)

제공된 UIElement의 좌표 원점에서 선택적으로 계산되는 포인터 위치의 x 및 y 좌표를 반환합니다.

적용 대상

추가 정보