DesiredRotation Property
Collapse the table of content
Expand the table of content

InertiaRotationBehavior2D.DesiredRotation Property

.NET Framework (current version)

Gets or sets the desired rotation, in radians.

Namespace:   System.Windows.Input.Manipulations
Assembly:  System.Windows.Input.Manipulations (in System.Windows.Input.Manipulations.dll)

public float DesiredRotation { get; set; }

Property Value

Type: System.Single

The desired rotation, in radians.

This property represents the desired ending rotation of the inertia operation. This property value is mutually exclusive with the DesiredDeceleration property; setting this property will set DesiredDeceleration to NaN. The default value for both this property and DesiredDeceleration is NaN. You must set one or the other property before inertia processing starts.

DesiredRotation must be a finite, non-negative number. The direction of rotation is determined by the InitialVelocity property.

This property cannot be set while the inertia processor is running; otherwise, an exception is thrown.

In the following example, the DesiredRotation property is set to enable inertia processing to rotate an object three-and-one-half times from its starting orientation.

#region SetDesiredRotation
// PI * 2 radians = 360 degrees.
inertiaProcessor.RotationBehavior.DesiredRotation = (float)Math.PI * 7.0f;

.NET Framework
Available since 4.0
Return to top
© 2016 Microsoft