Export (0) Print
Expand All

ManipulationPivot2D Class

Represents pivot information used by a manipulation processor for single-manipulator rotations.

System.Object
  System.Windows.Input.Manipulations.ManipulationParameters2D
    System.Windows.Input.Manipulations.ManipulationPivot2D

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

public sealed class ManipulationPivot2D : ManipulationParameters2D

The ManipulationPivot2D type exposes the following members.

  NameDescription
Public methodManipulationPivot2DInitializes a new instance of the ManipulationPivot2D class.
Top

  NameDescription
Public propertyRadiusGets or sets the distance from the pivot point to the edge of the manipulatable region.
Public propertyXGets or sets the X position of the pivot.
Public propertyYGets or sets the Y position of the pivot.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

When a ManipulationPivot2D object is assigned to the Pivot property of a ManipulationProcessor2D object, it affects how the manipulation processor calculates rotational changes to an element when the element is being manipulated by a single manipulator. If more than one manipulator is being applied to the element during manipulation, the Pivot property is ignored.

In a single-manipulator scenario, an element can rotate as it is being dragged. The X and Y properties of the ManipulationPivot2D object determine what position the element rotates around, and the Radius property is used by the manipulation processor to calculate the amount of rotational change.

For instance, if the single manipulator is near the outer edge of the pivot point, the rotational change to the element as it is being dragged will be fairly large (depending upon the size of the element). If the manipulator is close to the center of the pivot point, very little (if any) rotation will occur.

Typically, the X and Y properties represent the center of the element that is being manipulated, and the Radius property represents the distance from the center of the element to its farthest edge.

As the element moves, the X and Y properties of the ManipulationPivot2D object need to be updated so that rotation will continue to occur around the proper point.

The following code example shows how the X and Y properties for a pivot point are updated to match the center of the element that is being manipulated.

#region ManipulationProcessor2D
private double ElementCenterX
{
    get { return elementPosition.X; }
    set
    {
        elementPosition.X = value;
        manipulationProcessor.Pivot.X = (float)value;
    }
}

private double ElementCenterY
{
    get { return elementPosition.Y; }
    set
    {
        elementPosition.Y = value;
        manipulationProcessor.Pivot.Y = (float)value;
    }
}
#endregion

.NET Framework

Supported in: 4.6, 4.5, 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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft