Share via


AdornerLayout Class

Performs the layout of an adorner on the DesignerView.

Inheritance Hierarchy

System.Object
  Microsoft.Windows.Design.Interaction.AdornerLayout

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

Syntax

'Declaration
Public MustInherit Class AdornerLayout
public abstract class AdornerLayout
public ref class AdornerLayout abstract
[<AbstractClass>]
type AdornerLayout =  class end
public abstract class AdornerLayout

The AdornerLayout type exposes the following members.

Constructors

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

Top

Methods

  Name Description
Public method AdornerPropertyChanged Invoked on the adorner layout whenever one of the properties stored in the AdornerProperties class changes.
Public method Arrange Performs the layout arrangement on the specified adorner.
Public method ArrangeChildren Performs the layout arrangement on the AdornerPanel.
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method EvaluateLayout Gets a value indicating whether the adorner remains in the UI tree.
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 GetType Gets the Type of the current instance. (Inherited from Object.)
Public method IsAssociated Gets a value indicating whether the specified model item is associated with this adorner.
Public method Measure Performs the layout measurement on the specified adorner.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Remarks

In most Windows Presentation Foundation (WPF) UI trees, layout occurs top-down through the Arrange and Measure methods. Adorners cannot directly take advantage of this because an adorner is typically laying itself out relative to an element that is not a direct child or parent. Some complex adorners even have to calculate their size and position based on the positions of several other elements, something WPF cannot do.

The AdornerLayout class is designed to improve this. Every time the layout is updated in EvaluateLayout, the AdornerLayout’s EvaluateLayout method is called. This method should determine whether the adorner has to be re-measured or re-arranged, and call the appropriate InvalidateMeasure or InvalidateArrange methods on the adorner.

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

AdornerPanel

PrimarySelectionAdornerProvider

Other Resources

Walkthrough: Creating a Design-time Adorner

Adorner Architecture