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、ManipulationStartedManipulationDeltaManipulationInertiaStartingおよび ManipulationCompleted イベントを使用して直接操作するためのいくつかの使用パターンを示します。

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 クラスの新しいインスタンスを初期化します。

プロパティ

Container

操作のコンテナーと見なされる UIElement を取得します。

Cumulative

操作の開始以降の全体的な変更を取得します。

Delta

現在の操作の最新の変更を ManipulationDelta として取得します。

ExpansionBehavior

慣性による膨張運動の速度の低下率を取得または設定します。

Handled

ルーティング イベントを処理済みとしてマークする値を取得または設定します。 の true 値を指定 Handled すると、イベント ルートに沿ったほとんどのハンドラーが同じイベントを再び処理できなくなります。

OriginalSource

イベントを発生させたオブジェクトへの参照を取得します。 これは多くの場合、アプリ UI で宣言された要素ではなく、コントロールのテンプレート部分です。

(継承元 RoutedEventArgs)
PointerDeviceType

操作に関係するポインター デバイスの PointerDeviceType を取得します。

RotationBehavior

このイベント発生の操作に関連付けられている回転情報に関する情報を取得します。

TranslationBehavior

このイベント発生の操作に関連付けられている変換情報に関する情報を取得します。

Velocities

操作に対する最新の変更の速度を取得します。

適用対象

こちらもご覧ください

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