NodeShape.OnAbsoluteBoundsChanged Method
Called when the size or location of the shape have changed.
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0.dll)
Override this method in your shape class, to respond to a change of shape or location. This method will be called only if the old and new values are different. Make sure that you call [base.OnAbsoluteBoundsChanged(e)].
When to use this method
-
Use this method when you want to update values that are not in the Store – that is, they are not properties of the model or diagram elements. This method is always called after the bounding box changes, even when the user invokes the Undo command.
-
If you want to respond to the change by making another change inside the model or diagram – for example to adjust the position of neighboring shapes - create a ChangeRule to observe the AbsoluteBounds domain property in your shape class. In an Undo, all the in-store properties are reset by the Undo handler, and the change rule is not called. For more information, see the example in AbsoluteBoundsDomainPropertyId.
-
If you want to constrain the size or location of a shape, use BoundsRules.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.