ManipulationStartingRoutedEventArgs class
Provides data for the ManipulationStarting, event.
Inheritance
- Object
- RoutedEventArgs
- ManipulationStartingRoutedEventArgs
Syntax
Attributes
- ActivatableAttribute(NTDDI_WIN8)
- MarshalingBehaviorAttribute(Agile)
- ThreadingAttribute(Both)
- VersionAttribute(NTDDI_WIN8)
- WebHostHiddenAttribute()
Members
The ManipulationStartingRoutedEventArgs class has these types of members:
Constructors
The ManipulationStartingRoutedEventArgs class has these constructors.
| Constructor | Description |
|---|---|
| ManipulationStartingRoutedEventArgs | Initializes a new instance of the ManipulationStartingRoutedEventArgs class. |
Methods
The ManipulationStartingRoutedEventArgs class inherits methods from the Object class.
Properties
The ManipulationStartingRoutedEventArgs class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read/write | Gets the UIElement that is considered the container of the manipulation. | |
| Read/write | Gets or sets a value that marks the routed event as handled. Setting to true prevents most handlers along the event route from handling the same event again. | |
| Read/write | Gets or sets which types of manipulations are possible. | |
| Read-only | Gets a reference to the object that raised the event. (Inherited from RoutedEventArgs) | |
| Read/write | Gets or sets an object that describes the pivot for a single-point manipulation. |
Examples
The following code example shows scenario 4 from the Input sample. This code shows some usage patterns for direct manipulation using the ManipulationStarting, ManipulationStarted, ManipulationDelta, ManipulationInertiaStarting, and ManipulationCompleted events.
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(); }
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 12/4/2012
