ManipulationDeltaEventArgs 클래스

정의

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

public ref class ManipulationDeltaEventArgs sealed : System::Windows::Input::InputEventArgs
public sealed class ManipulationDeltaEventArgs : System.Windows.Input.InputEventArgs
type ManipulationDeltaEventArgs = class
    inherit InputEventArgs
Public NotInheritable Class ManipulationDeltaEventArgs
Inherits InputEventArgs
상속
ManipulationDeltaEventArgs

예제

다음 예제에서는 이벤트 처리기는 ManipulationDelta 이벤트입니다. 예제에서는 합니다 DeltaManipulation 속성을 이동, 크기 조정 및 회전을 Rectangle. 예제에서는 또한 확인 여부를 ManipulationDelta 관성 및 사각형 창 가장자리에 접촉 되어 있는지 여부는 동안 이벤트가 발생 합니다. 이러한 경우에 해당할 경우 애플리케이션에서 애플리케이션의 표시 영역을 벗어나지 사각형을 방지 하기 위해 조작을 중지 합니다. 이 예제는에서 더 큰 예제의 일부 연습: 만드는 첫 번째 터치 애플리케이션합니다.

void Window_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
{
    
    // Get the Rectangle and its RenderTransform matrix.
    Rectangle rectToMove = e.OriginalSource as Rectangle;
    Matrix rectsMatrix = ((MatrixTransform)rectToMove.RenderTransform).Matrix;

    // Rotate the Rectangle.
    rectsMatrix.RotateAt(e.DeltaManipulation.Rotation, 
                         e.ManipulationOrigin.X, 
                         e.ManipulationOrigin.Y);

    // Resize the Rectangle.  Keep it square 
    // so use only the X value of Scale.
    rectsMatrix.ScaleAt(e.DeltaManipulation.Scale.X, 
                        e.DeltaManipulation.Scale.X, 
                        e.ManipulationOrigin.X,
                        e.ManipulationOrigin.Y);

    // Move the Rectangle.
    rectsMatrix.Translate(e.DeltaManipulation.Translation.X,
                          e.DeltaManipulation.Translation.Y);

    // Apply the changes to the Rectangle.
    rectToMove.RenderTransform = new MatrixTransform(rectsMatrix);

    Rect containingRect =
        new Rect(((FrameworkElement)e.ManipulationContainer).RenderSize);

    Rect shapeBounds =
        rectToMove.RenderTransform.TransformBounds(
            new Rect(rectToMove.RenderSize));

    // Check if the rectangle is completely in the window.
    // If it is not and intertia is occuring, stop the manipulation.
    if (e.IsInertial && !containingRect.Contains(shapeBounds))
    {
        e.Complete();
    }

    e.Handled = true;
}
Private Sub Window_ManipulationDelta(ByVal sender As Object, ByVal e As ManipulationDeltaEventArgs)

    ' Get the Rectangle and its RenderTransform matrix.
    Dim rectToMove As Rectangle = e.OriginalSource
    Dim rectTransform As MatrixTransform = rectToMove.RenderTransform
    Dim rectsMatrix As Matrix = rectTransform.Matrix


    ' Rotate the shape
    rectsMatrix.RotateAt(e.DeltaManipulation.Rotation,
                         e.ManipulationOrigin.X,
                         e.ManipulationOrigin.Y)

    ' Resize the Rectangle. Keep it square 
    ' so use only the X value of Scale.
    rectsMatrix.ScaleAt(e.DeltaManipulation.Scale.X,
                        e.DeltaManipulation.Scale.X,
                        e.ManipulationOrigin.X,
                        e.ManipulationOrigin.Y)

    'move the center
    rectsMatrix.Translate(e.DeltaManipulation.Translation.X,
                          e.DeltaManipulation.Translation.Y)

    ' Apply the changes to the Rectangle.
    rectTransform = New MatrixTransform(rectsMatrix)
    rectToMove.RenderTransform = rectTransform

    Dim container As FrameworkElement = e.ManipulationContainer
    Dim containingRect As New Rect(container.RenderSize)

    Dim shapeBounds As Rect = rectTransform.TransformBounds(
                                New Rect(rectToMove.RenderSize))

    ' Check if the rectangle is completely in the window.
    ' If it is not and intertia is occuring, stop the manipulation.
    If e.IsInertial AndAlso Not containingRect.Contains(shapeBounds) Then
        e.Complete()
    End If

    e.Handled = True
End Sub

설명

ManipulationDeltaEventArgs 클래스 조작의 위치에 대 한 변경 내용에 대 한 데이터를 포함 합니다. 합니다 DeltaManipulation 속성 마지막 이후에 발생 한 변경 내용이 들어 ManipulationDelta 이벤트가 발생 합니다. CumulativeManipulation 속성 현재 조작에 대해 발생 한 총 변경 내용을 포함 합니다. 조작할 수 있는 개체를 변환할 이러한 속성 중 하나를 사용 합니다.

호출 하 여 조작을 종료할 수 있습니다 합니다 Complete 메서드나 조작 호출 하 여 관성에 적용할은 StartInertia 메서드.

속성

CumulativeManipulation

현재 조작의 누적된 변경 사항을 가져옵니다.

DeltaManipulation

현재 조작의 최신 변경 사항을 가져옵니다.

Device

이 이벤트를 시작한 입력 디바이스를 가져옵니다.

(다음에서 상속됨 InputEventArgs)
Handled

경로를 따라 이동할 때 라우트된 이벤트의 현재 이벤트 처리 상태를 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 RoutedEventArgs)
IsInertial

무활동 중 ManipulationDelta 이벤트가 발생하는지 여부를 나타내는 값을 가져옵니다.

ManipulationContainer

조작의 좌표를 정의하는 컨테이너를 가져옵니다.

ManipulationOrigin

조작이 발생한 점을 가져옵니다.

Manipulators

조작을 위한 터치 접촉을 나타내는 개체의 컬렉션을 가져옵니다.

OriginalSource

부모 클래스에 의한 Source 조정 앞에 순수 적중 횟수 테스트에서 결정한 원본 보고 소스를 가져옵니다.

(다음에서 상속됨 RoutedEventArgs)
RoutedEvent

RoutedEventArgs 인스턴스와 연결된 RoutedEvent를 가져오거나 설정합니다.

(다음에서 상속됨 RoutedEventArgs)
Source

이벤트를 발생시킨 개체에 대한 참조를 가져오거나 설정합니다.

(다음에서 상속됨 RoutedEventArgs)
Timestamp

이 이벤트가 발생한 시간을 가져옵니다.

(다음에서 상속됨 InputEventArgs)
Velocities

조작에 대한 최신 변경 사항의 비율을 가져옵니다.

메서드

Cancel()

조작을 취소합니다.

Complete()

무활동 상태 없이 조작을 완료합니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
InvokeEventHandler(Delegate, Object)

형식별 방식으로 이벤트 처리기를 호출하여 이벤트 시스템의 효율성을 높입니다.

(다음에서 상속됨 InputEventArgs)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
OnSetSource(Object)

파생된 클래스에서 재정의되는 경우 인스턴스의 Source 속성 값이 변경될 때마다 알림 콜백 진입점을 제공합니다.

(다음에서 상속됨 RoutedEventArgs)
ReportBoundaryFeedback(ManipulationDelta)

특정 경계를 넘어 조작이 수행되었음을 지정합니다.

StartInertia()

이후 접촉 이동을 무시하고 ManipulationInertiaStarting 이벤트를 발생시켜 조작에 대한 무활동 상태를 시작합니다.

ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상