Share via


NodeShape.Anchoring Property

Describes how the shape should position and size itself as the parent shape moves and resizes. Alter the returned object as required.

Namespace:  Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.dll)

Syntax

'Declaration
Public ReadOnly Property Anchoring As AnchoringBehavior
'Usage
Dim instance As NodeShape 
Dim value As AnchoringBehavior 

value = instance.Anchoring
public AnchoringBehavior Anchoring { get; }
public:
property AnchoringBehavior^ Anchoring {
    AnchoringBehavior^ get ();
}
public function get Anchoring () : AnchoringBehavior

Property Value

Type: Microsoft.VisualStudio.Modeling.Diagrams.AnchoringBehavior

Remarks

The Anchoring contains settings that specify whether the sides of the shape are coupled to sides of the parent, or to sides of siblings.

Typically you set Anchoring for a shape and its children in an override of InitializeInstanceResources.

Examples

   
protected override void InitializeInstanceResources()
{
  base.InitializeInstanceResources();
  this.Anchoring.SetLeftAnchor(AnchoringBehavior.Edge.Left, 0.01);
  this.Anchoring.SetTopAnchor(AnchoringBehavior.Edge.Top, 0.01);

  // Set Anchoring for child shapes here ...
}

.NET Framework Security

See Also

Reference

NodeShape Class

NodeShape Members

Microsoft.VisualStudio.Modeling.Diagrams Namespace

HasAnchoring