SpotPanel
This panel is useful for positioning child elements relative either to the bounds of a particular child or to a computed rectangle.
Inherits: Panel
Methods
protected override Size ArrangeOverride(Size finalSize)
result = spotPanel.ArrangeOverride(finalSize)
Arrange all of the children according to the Spot and Alignment attached properties and the size of the first child with the Main attached property.
- finalSize
protected virtual Rect ComputeBorder()
result = spotPanel.ComputeBorder()
Compute the rectangle in which the elements should be positioned.
Returns: If this panel is in an Adornment and is its LocationElement, return the AdornedElement's size. Otherwise return a Rect based on this first child's DesiredSize. Only the Width and Height of the Rect matter in the calculations performed by Size) and Size).
public static Spot GetAlignment(DependencyObject d)
result = SpotPanel.GetAlignment(d)
Gets the Spot point of the element that should be positioned at the DependencyObject) point.
- d
- a UIElement
Returns: This defaults to Center
public static bool GetMain(DependencyObject d)
result = SpotPanel.GetMain(d)
Gets whether the element is considered the "main" element for the SpotPanel, around which all of the sibling elements are positioned.
- d
- this should be a child of a SpotPanel
Returns: This defaults to false.
public static Spot GetSpot(DependencyObject d)
result = SpotPanel.GetSpot(d)
Gets the Spot at which the element should be positioned.
- d
- a UIElement
Returns: This defaults to Center
protected override Size MeasureOverride(Size availableSize)
result = spotPanel.MeasureOverride(availableSize)
Measure all of the children and return the size of the union of the bounds of the elements positioned according to the Spot and Alignment attached properties and the size of the element with the Main attached property.
- availableSize
public static void SetAlignment(DependencyObject d, Spot v)
SpotPanel.SetAlignment(d, v)
Sets the Spot point of the element that should be positioned at the DependencyObject) point.
- d
- a UIElement
- v
- a Spot for which IsSpot is true; the panel assumes Center otherwise
public static void SetMain(DependencyObject d, bool v)
SpotPanel.SetMain(d, v)
Sets whether the element is considered the "main" element for the SpotPanel, around which all of the sibling elements are positioned.
- d
- this should be a child of a SpotPanel
- v
- only one such child of the SpotPanel should have this property set to true
public static void SetSpot(DependencyObject d, Spot v)
SpotPanel.SetSpot(d, v)
Sets the Spot at which the element should be positioned.
- d
- a UIElement
- v
- a Spot for which IsSpot is true; the panel assumes Center otherwise
Fields
public static readonly DependencyProperty AlignmentProperty
value = SpotPanel.AlignmentProperty
Identifies the Alignment attached dependency property.
public static readonly DependencyProperty MainProperty
value = SpotPanel.MainProperty
Identifies the Main attached dependency property.
public static readonly DependencyProperty SpotProperty
value = SpotPanel.SpotProperty
Identifies the Spot attached dependency property.