Export (0) Print
Expand All

InertiaRotationBehavior2D.DesiredRotation Property

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;
#endregion

.NET Framework

Supported in: 4.5.3, 4

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft