Visual Basic (Declaration) | |
---|---|
Public Property Location As Point |
C# | |
---|---|
public Point Location {get; set;} |
Property Value
ThePoint
is in model coordinates. The value is related to Node.Position. It may have a different value than Node.Position depending on the values of LocationSpot and Node.LocationElementName. The value is actually stored on the Part.VisualElement. One normally sets it by setting or data-binding the attached property on the root element of the DataTemplate.It is common to set the LocationSpot to Spot.Center, so that the location of the node is always the coordinates of the center point of the Node.LocationElement. The Node.Position always refers to the top-left corner point of the Part.Bounds. Setting the Node.Position will also update this Node.Location.
Grid snapping, for example, will normally locate node Location
s to be on grid points. (But you can change that by setting GridSnapCellSpot.) By setting the node's LocationSpot to be the center of one of the node's elements, by default the whole node, the element will be centered at the location.
The MinLocation and MaxLocation also operate on the node's location, not its position.
However, the Move method takes a position, not a location.
This attached dependency property is set by various tools and layouts. Therefore one-way data-bindings of this attached dependency property to changing source properties may not get updated values.