Share via


PlacementAdapter Class

An adapter that is used to get and set positions of objects in parent coordinates.

Inheritance Hierarchy

System.Object
  Microsoft.Windows.Design.Features.FeatureProvider
    Microsoft.Windows.Design.Interaction.Adapter
      Microsoft.Windows.Design.Interaction.PlacementAdapter
        Microsoft.Windows.Design.Interaction.RootPlacementAdapter

Namespace:  Microsoft.Windows.Design.Interaction
Assembly:  Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)

Syntax

'Declaration
Public MustInherit Class PlacementAdapter _
    Inherits Adapter
public abstract class PlacementAdapter : Adapter
public ref class PlacementAdapter abstract : public Adapter
[<AbstractClass>]
type PlacementAdapter =  
    class
        inherit Adapter
    end
public abstract class PlacementAdapter extends Adapter

The PlacementAdapter type exposes the following members.

Constructors

  Name Description
Protected method PlacementAdapter Initializes a new instance of the PlacementAdapter class.

Top

Properties

  Name Description
Public property AdapterType Gets the type of adapter this class represents. (Overrides Adapter.AdapterType.)

Top

Methods

  Name Description
Public method BeginPlacement Begins the placement operation.
Public method CanSetPosition Returns a value that indicates whether the specified coordinate can be set.
Public method EndPlacement Ends the placement operation.
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetPlacement Returns a collection of positions that describe the placement of the specified item.
Public method GetPlacementBoundary(ModelItem) Gets the boundary of the specified item parent.
Public method GetPlacementBoundary(ModelItem, PlacementIntent, array<RelativeValue[]) Gets the boundary of the specified item's parent.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method SetNudgePlacements(ModelItem, NudgeIntent, array<RelativeValue[]) Assigns the specified array of positions for moving controls during keyboard nudges.
Public method SetNudgePlacements(ModelItem, NudgeIntent, RelativeValueCollection) Assigns the specified collection of positions for moving controls during keyboard nudges.
Public method SetPlacements(ModelItem, PlacementIntent, array<RelativeValue[]) Assigns the specified array of positions to the specified model item.
Public method SetPlacements(ModelItem, PlacementIntent, RelativeValueCollection) Assigns the specified collection of positions to the specified model item.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Remarks

PlacementAdapter is used by grab handles to size and move controls. Placement adapters work by supporting reading and writing values as relative positions. To a PlacementAdapter everything is relative, so relative difference (deltas) are important. A PlacementAdapter takes a relative value and converts it into one or more property sets. To use a PlacementAdapter first query it to see whether it can set a position you are interested in setting. Then, use the results of this to get and set values through the GetPlacement and SetPlacements methods.

Thread Safety

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

See Also

Reference

Microsoft.Windows.Design.Interaction Namespace

AdornerPlacementCollection

AdornerPanel

Other Resources

Walkthrough: Creating a Design-time Adorner

Adorner Architecture