ManipulationPivot2D Class
Represents pivot information used by a manipulation processor for single-manipulator rotations.
System.Windows.Input.Manipulations::ManipulationParameters2D
System.Windows.Input.Manipulations::ManipulationPivot2D
Assembly: System.Windows.Input.Manipulations (in System.Windows.Input.Manipulations.dll)
The ManipulationPivot2D type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
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
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
