ManipulationCompletedRoutedEventArgs クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
ManipulationCompleted イベントのデータを指定します。
public ref class ManipulationCompletedRoutedEventArgs 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 ManipulationCompletedRoutedEventArgs 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 ManipulationCompletedRoutedEventArgs 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 ManipulationCompletedRoutedEventArgs : 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 ManipulationCompletedRoutedEventArgs : RoutedEventArgs
Public NotInheritable Class ManipulationCompletedRoutedEventArgs
Inherits RoutedEventArgs
- 継承
- 属性
Windows の要件
デバイス ファミリ |
Windows 10 (10.0.10240.0 で導入)
|
API contract |
Windows.Foundation.UniversalApiContract (v1.0 で導入)
|
例
次のコード例は 、入力サンプルのシナリオ 4 を示しています。 このコードでは、ManipulationStarting、ManipulationStarted、ManipulationDelta、ManipulationInertiaStarting、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();
}
Private _transformGroup As TransformGroup
Private _previousTransform As MatrixTransform
Private _compositeTransform As CompositeTransform
Private forceManipulationsToEnd As Boolean
Public Sub New()
Me.InitializeComponent()
forceManipulationsToEnd = False
AddHandler ManipulateMe.ManipulationStarting, AddressOf ManipulateMe_ManipulationStarting
AddHandler ManipulateMe.ManipulationStarted, AddressOf ManipulateMe_ManipulationStarted
AddHandler ManipulateMe.ManipulationDelta, AddressOf ManipulateMe_ManipulationDelta
AddHandler ManipulateMe.ManipulationCompleted, AddressOf ManipulateMe_ManipulationCompleted
InitManipulationTransforms()
End Sub
''' <summary>
''' Invoked when this page is about to be displayed in a Frame.
''' </summary>
''' <param name="e">Event data that describes how this page was reached. The Parameter
''' property is typically used to configure the page.</param>
Protected Overrides Sub OnNavigatedTo(e As NavigationEventArgs)
End Sub
Private Sub InitManipulationTransforms()
_transformGroup = New TransformGroup()
_compositeTransform = New CompositeTransform()
_previousTransform = New MatrixTransform() With { _
.Matrix = Matrix.Identity _
}
_transformGroup.Children.Add(_previousTransform)
_transformGroup.Children.Add(_compositeTransform)
ManipulateMe.RenderTransform = _transformGroup
End Sub
Private Sub ManipulateMe_ManipulationStarting(sender As Object, e As ManipulationStartingRoutedEventArgs)
forceManipulationsToEnd = False
e.Handled = True
End Sub
Private Sub ManipulateMe_ManipulationStarted(sender As Object, e As ManipulationStartedRoutedEventArgs)
e.Handled = True
End Sub
Private Sub ManipulateMe_ManipulationDelta(sender As Object, e As ManipulationDeltaRoutedEventArgs)
If forceManipulationsToEnd Then
e.Complete()
Exit Sub
End If
_previousTransform.Matrix = _transformGroup.Value
Dim center As Point = _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 = InlineAssignHelper(_compositeTransform.ScaleY, e.Delta.Scale)
_compositeTransform.TranslateX = e.Delta.Translation.X
_compositeTransform.TranslateY = e.Delta.Translation.Y
e.Handled = True
End Sub
Private Sub ManipulateMe_ManipulationCompleted(sender As Object, e As ManipulationCompletedRoutedEventArgs)
e.Handled = True
End Sub
Private Sub Scenario4ResetMethod(sender As Object, e As RoutedEventArgs)
Reset()
End Sub
Private Sub Reset()
forceManipulationsToEnd = True
ManipulateMe.RenderTransform = Nothing
InitManipulationTransforms()
End Sub
Private Shared Function InlineAssignHelper(Of T)(ByRef target As T, value As T) As T
target = value
Return value
End Function
コンストラクター
ManipulationCompletedRoutedEventArgs() |
ManipulationCompletedRoutedEventArgs クラスの新しいインスタンスを初期化します。 |
プロパティ
Container |
操作のコンテナーと見なされる UIElement を取得します。 |
Cumulative |
操作の開始以降の全体的な変更を取得します。 |
Handled |
ルーティング イベントを処理済みとしてマークする値を取得または設定します。 を true に設定すると、イベント ルートに沿ったほとんどのハンドラーが同じイベントを再び処理できなくなります。 |
IsInertial |
慣性時に ManipulationCompleted イベントが発生するかどうかを取得します。 |
OriginalSource |
イベントを発生させたオブジェクトへの参照を取得します。 これは多くの場合、アプリ UI で宣言された要素ではなく、コントロールのテンプレート部分です。 (継承元 RoutedEventArgs) |
PointerDeviceType |
操作に関係するポインター デバイスの PointerDeviceType を取得します。 |
Position |
完了した位置にあるタッチ入力の x 画面座標と y 画面座標を取得します。 |
Velocities |
操作に使用される速度を取得します。 |
適用対象
こちらもご覧ください
- <xref:Windows.UI.Xaml.RoutedEventArgs%0andows.ui.xaml%2froutedeventargs.md)>