UIElement.PointerReleased 이벤트

정의

이 요소 내에서 이전에 Press 동작을 시작한 포인터 디바이스가 해제될 때 발생합니다. Press 동작의 끝은 PointerReleased 이벤트를 발생시키지 않습니다. 다른 이벤트가 대신 발생할 수 있습니다. 자세한 내용은 비고를 참조하세요.

public:
 virtual event PointerEventHandler ^ PointerReleased;
// Register
event_token PointerReleased(PointerEventHandler const& handler) const;

// Revoke with event_token
void PointerReleased(event_token const* cookie) const;

// Revoke with event_revoker
UIElement::PointerReleased_revoker PointerReleased(auto_revoke_t, PointerEventHandler const& handler) const;
public event PointerEventHandler PointerReleased;
function onPointerReleased(eventArgs) { /* Your code */ }
uIElement.addEventListener("pointerreleased", onPointerReleased);
uIElement.removeEventListener("pointerreleased", onPointerReleased);
- or -
uIElement.onpointerreleased = onPointerReleased;
Public Custom Event PointerReleased As PointerEventHandler 
<uiElement PointerReleased="eventhandler"/>

이벤트 유형

설명

터치, 마우스 및 펜/스타일러스 상호 작용은 UWP 앱에서 포인터 입력으로 수신, 처리 및 관리됩니다. 이러한 상호 작용 중 하나라도 PointerReleased 이벤트를 생성할 수 있습니다. 자세한 내용은 포인터 입력 처리를 참조하세요.

PointerReleased 대신 다른 이벤트는 작업의 끝에서 발생할 수 있습니다(예: PointerCanceled 또는 PointerCaptureLost). PointerPressed 및 PointerReleased 이벤트는 항상 쌍으로 발생하지 않습니다. 제대로 작동하려면 앱이 언론 작업에 대한 결론을 나타내는 모든 이벤트를 수신 대기하고 처리해야 합니다. PointerReleased 발생이 발생하지 않는 몇 가지 이유는 다음과 같습니다.

  • 특정 하드웨어가 터치 작업을 처리하는 방법 및 누름 작업의 차이점
  • 다른 포인터에서 프로그래밍 포인터 캡처
  • 디스플레이 영역의 관계를 변경하는 사용자 작업(예: 해상도 변경 또는 설정 모니터링)
  • 이전 터치 동작과 동일한 표면을 터치하는 스타일러스와 같은 입력 상호 작용

PointerReleased 이벤트를 처음 발생시키는 사용자 작업은 Tapped 이벤트가 발생하거나 디바이스마다 다른 조건에서 RightTapped 가 발생할 수도 있습니다. 자세한 내용은 탭 및RightTapped을 참조하세요.

마우스 입력이 먼저 감지되면 마우스 입력이 할당된 단일 포인터와 연결됩니다. 마우스 단추(왼쪽, 휠 또는 오른쪽)를 클릭하면 PointerPressed 이벤트를 통해 포인터와 해당 단추 간의 보조 연결이 만들어집니다. PointerReleased 이벤트는 해당하는 동일한 마우스 단추를 해제한 경우에만 발생합니다(이 이벤트가 완료될 때까지는 다른 단추를 이 포인터와 연결할 수 없음). 이 독점적인 연결 때문에 다른 마우스 단추 클릭은 PointerMoved 이벤트를 통해 라우트됩니다. 다음 예제와 같이 이 이벤트를 처리할 때 마우스 단추 상태를 테스트할 수 있습니다.

private void Target_PointerMoved(object sender, PointerRoutedEventArgs e)
{
    Windows.UI.Xaml.Input.Pointer ptr = e.Pointer;

    // Multiple, simultaneous mouse button inputs are processed here.
    // Mouse input is associated with a single pointer assigned when 
    // mouse input is first detected. 
    // Clicking additional mouse buttons (left, wheel, or right) during 
    // the interaction creates secondary associations between those buttons 
    // and the pointer through the pointer pressed event. 
    // The pointer released event is fired only when the last mouse button 
    // associated with the interaction (not necessarily the initial button) 
    // is released. 
    // Because of this exclusive association, other mouse button clicks are 
    // routed through the pointer move event.          
    if (ptr.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse)
    {
        // To get mouse state, we need extended pointer details.
        // We get the pointer info through the getCurrentPoint method
        // of the event argument. 
        Windows.UI.Input.PointerPoint ptrPt = e.GetCurrentPoint(Target);
        if (ptrPt.Properties.IsLeftButtonPressed)
        {
            eventLog.Text += "\nLeft button: " + ptrPt.PointerId;
        }
        if (ptrPt.Properties.IsMiddleButtonPressed)
        {
            eventLog.Text += "\nWheel button: " + ptrPt.PointerId;
        }
        if (ptrPt.Properties.IsRightButtonPressed)
        {
            eventLog.Text += "\nRight button: " + ptrPt.PointerId;
        }
    }

    // Prevent most handlers along the event route from handling the same event again.
    e.Handled = true;

    // Display pointer details.
    updateInfoPop(e);
}
private void Target_PointerMoved(object sender, PointerRoutedEventArgs e)
{
    Windows.UI.Xaml.Input.Pointer ptr = e.Pointer;

    // Multiple, simultaneous mouse button inputs are processed here.
    // Mouse input is associated with a single pointer assigned when 
    // mouse input is first detected. 
    // Clicking additional mouse buttons (left, wheel, or right) during 
    // the interaction creates secondary associations between those buttons 
    // and the pointer through the pointer pressed event. 
    // The pointer released event is fired only when the last mouse button 
    // associated with the interaction (not necessarily the initial button) 
    // is released. 
    // Because of this exclusive association, other mouse button clicks are 
    // routed through the pointer move event.          
    if (ptr.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse)
    {
        // To get mouse state, we need extended pointer details.
        // We get the pointer info through the getCurrentPoint method
        // of the event argument. 
        Windows.UI.Input.PointerPoint ptrPt = e.GetCurrentPoint(Target);
        if (ptrPt.Properties.IsLeftButtonPressed)
        {
            eventLog.Text += "\nLeft button: " + ptrPt.PointerId;
        }
        if (ptrPt.Properties.IsMiddleButtonPressed)
        {
            eventLog.Text += "\nWheel button: " + ptrPt.PointerId;
        }
        if (ptrPt.Properties.IsRightButtonPressed)
        {
            eventLog.Text += "\nRight button: " + ptrPt.PointerId;
        }
    }

    // Prevent most handlers along the event route from handling the same event again.
    e.Handled = true;

    // Display pointer details.
    updateInfoPop(e);
}

PointerReleased는 라우트된 이벤트입니다. 라우트된 이벤트 개념에 대한 자세한 내용은 이벤트 및 라우트된 이벤트 개요를 참조하세요.

터치 동작의 경우와 터치 동작의 결과인 조작 관련 또는 조작 이벤트의 경우에도 이벤트 원본이 되거나 터치 동작과 연관된 이벤트를 실행하려면 요소의 적중 횟수 테스트가 보여야 합니다. UIElement.Visibility표시되어야 합니다. 파생 형식의 다른 속성도 적중 테스트 표시 유형에 영향을 미칩니다. 자세한 내용은 이벤트 및 라우트된 이벤트 개요를 참조하세요.

PointerReleased는 이벤트에 대한 이벤트 데이터가 처리됨으로 표시된 경우에도 호출될 경로에 이벤트 처리기를 연결하는 기능을 지원 합니다. AddHandler를 참조하세요.

특정 Windows 런타임 컨트롤에는 PointerReleased 입력 이벤트에 대한 클래스 기반 처리가 있을 수 있습니다. 이 경우 컨트롤에 OnPointerReleased 메서드에 대한 재정의가 있는 것일 수 있습니다. 일반적으로 이벤트는 클래스 처리기에 의해 처리된 것으로 표시되며 PointerReleased 이벤트는 해당 컨트롤의 사용자 코드 처리기에서 처리하기 위해 발생하지 않습니다. 이벤트에 대한 클래스 기반 처리의 작동 방식에 대한 자세한 내용은 이벤트 및 라우트된 이벤트 개요를 참조하세요.

컨트롤에는 이벤트와 독립적으로 실행되는 PointerUpThemeAnimation 성격 애니메이션이 있을 수도 있습니다.

적용 대상

추가 정보