Share via


ManipulationInertiaStartingRoutedEventArgs 클래스

정의

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

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

예제

다음 코드 예제에서는 입력 샘플의 시나리오 4를 보여줍니다. 이 코드는 ManipulationStarting, ManipulationStarted, ManipulationDelta, ManipulationInertiaStartingManipulationCompleted 이벤트를 사용하여 직접 조작을 위한 몇 가지 사용 패턴을 보여 줍니다.

private TransformGroup _transformGroup;
private MatrixTransform _previousTransform;
private CompositeTransform _compositeTransform;
private bool forceManipulationsToEnd;

public Scenario4()
{
    this.InitializeComponent();
    forceManipulationsToEnd = false;
    ManipulateMe.ManipulationStarting += 
        new ManipulationStartingEventHandler(
            ManipulateMe_ManipulationStarting);
    ManipulateMe.ManipulationStarted += 
        new ManipulationStartedEventHandler(
            ManipulateMe_ManipulationStarted);
    ManipulateMe.ManipulationDelta += 
        new ManipulationDeltaEventHandler(
            ManipulateMe_ManipulationDelta);
    ManipulateMe.ManipulationCompleted += 
        new ManipulationCompletedEventHandler(
            ManipulateMe_ManipulationCompleted);
    ManipulateMe.ManipulationInertiaStarting += 
        new ManipulationInertiaStartingEventHandler(
            ManipulateMe_ManipulationInertiaStarting);
    InitManipulationTransforms();
}

private void InitManipulationTransforms()
{
    _transformGroup = new TransformGroup();
    _compositeTransform = new CompositeTransform();
    _previousTransform = new MatrixTransform() { 
        Matrix = Matrix.Identity };

    _transformGroup.Children.Add(_previousTransform);
    _transformGroup.Children.Add(_compositeTransform);

    ManipulateMe.RenderTransform = _transformGroup;
}

private void ManipulateMe_ManipulationStarting(object sender, 
    ManipulationStartingRoutedEventArgs e)
{
    forceManipulationsToEnd = false;
    e.Handled = true;
}

private void ManipulateMe_ManipulationStarted(
    object sender, ManipulationStartedRoutedEventArgs e)
{
    e.Handled = true;
}

private void ManipulateMe_ManipulationInertiaStarting(
    object sender, ManipulationInertiaStartingRoutedEventArgs e)
{
    e.Handled = true;
}

private void ManipulateMe_ManipulationDelta(
    object sender, ManipulationDeltaRoutedEventArgs e)
{
    if (forceManipulationsToEnd)
    {
        e.Complete();
        return;
    }

    _previousTransform.Matrix = _transformGroup.Value;

    Point center = _previousTransform.TransformPoint(
        new Point(e.Position.X, e.Position.Y));
    _compositeTransform.CenterX = center.X;
    _compositeTransform.CenterY = center.Y;

    _compositeTransform.Rotation = (e.Delta.Rotation * 180) / Math.PI;
    _compositeTransform.ScaleX = 
        _compositeTransform.ScaleY = e.Delta.Scale;
    _compositeTransform.TranslateX = e.Delta.Translation.X;
    _compositeTransform.TranslateY = e.Delta.Translation.Y;

    e.Handled = true;
}

private void ManipulateMe_ManipulationCompleted(object sender, 
    ManipulationCompletedRoutedEventArgs e)
{
    e.Handled = true;
}

private void Scenario4Reset(object sender, RoutedEventArgs e)
{
    Scenario4Reset();
}

void Scenario4Reset()
{
    forceManipulationsToEnd = true;
    ManipulateMe.RenderTransform = null;
    InitManipulationTransforms();
}

생성자

ManipulationInertiaStartingRoutedEventArgs()

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

속성

Container

조작의 컨테이너로 간주되는 UIElement 를 가져옵니다.

Cumulative

조작이 시작된 이후의 전체 변경 내용을 가져옵니다.

Delta

현재 조작의 최신 변경 내용을 ManipulationDelta로 가져옵니다.

ExpansionBehavior

확장 관성 이동이 느려지는 속도를 가져오거나 설정합니다.

Handled

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

OriginalSource

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

(다음에서 상속됨 RoutedEventArgs)
PointerDeviceType

조작과 관련된 포인터 디바이스에 대한 PointerDeviceType 을 가져옵니다.

RotationBehavior

이 이벤트 발생에 대한 조작과 관련된 회전 정보에 대한 정보를 가져옵니다.

TranslationBehavior

이 이벤트 발생에 대한 조작과 관련된 번역 정보에 대한 정보를 가져옵니다.

Velocities

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

적용 대상

추가 정보

  • <xref:Microsoft.UI.Xaml.RoutedEventArgs%0andows.ui.xaml%2froutedeventargs.md)>