PanelBase Class
Represents the base class for the various animated panels.
public abstract class PanelBase : Panel, ILogicalParent, IVisualParent
- Inheritance:
- object Visual UIElement FrameworkElement Panel object
- Derived:
- AnimatedCanvas AnimatedDockPanel AnimatedStackPanel AnimatedWrapPanel FanPanel SwitchPanel ZapPanel
- Implements:
- ILogicalParent IVisualParent
Constructors
PanelBase()
Initializes an instance of the class.
protected PanelBase()
Properties
AreLeavingElementsAnimated
Indicates whether elements that are leaving the panel will be automatically animated.
public bool AreLeavingElementsAnimated { get; set; }
Property Value
- bool:
trueif elements that are leaving the panel will be automatically animated; otherwise,false. The default value istrue.
ArrangeAnimation
The IArrangeAnimation that controls the animation of elements when arranging.
public IArrangeAnimation? ArrangeAnimation { get; set; }
Property Value
- IArrangeAnimation:
The default value is
null.
ArrangeAnimationResolved
The resolved IArrangeAnimation that controls the animation of elements when arranging.
public virtual IArrangeAnimation? ArrangeAnimationResolved { get; }
Property Value
Remarks
By default, this property simply returns the value of the ArrangeAnimation property. This property can be overridden by derived classes to provide custom logic.
HasLeavingChildren
Indicates whether there are any children that are leaving the panel.
public bool HasLeavingChildren { get; }
Property Value
- bool:
trueif there are any children that are leaving the panel; otherwise,false.
IsLayoutUpdatePending
Indicates whether a change to the layout logic has changed and the elements have yet to be arranged.
public bool IsLayoutUpdatePending { get; protected set; }
Property Value
- bool:
trueif a change to the layout logic has changed and the elements have yet to be arranged; otherwise,false. The default value isfalse.
LeavingChildren
The children that are currently leaving the panel.
public ReadOnlyCollection<UIElement> LeavingChildren { get; }
Property Value
VisualChildrenCount
protected override int VisualChildrenCount { get; }
Property Value
Methods
ArrangeElement(PanelBase, UIElement, bool)
Arranges the specified element using the current arrange state.
protected static void ArrangeElement(PanelBase panel, UIElement element, bool dispatch)
| Parameter | Type | Description |
|---|---|---|
| panel | PanelBase | The panel that contains the specified element; otherwise, |
| element | UIElement | The element. |
| dispatch | bool | if set to |
ArrangeElement(PanelBase?, UIElement, Rect?, bool)
Arranges the specified element using the current arrange state.
protected static void ArrangeElement(PanelBase? panel, UIElement element, Rect? finalRect, bool dispatch)
| Parameter | Type | Description |
|---|---|---|
| panel | PanelBase | The panel that contains the specified element; otherwise, |
| element | UIElement | The element. |
| finalRect | Rect? | The final rect to use to arrange element; otherwise, |
| dispatch | bool | if set to |
ArrangeElement(UIElement, bool)
Arranges the specified element using the current arrange state.
protected static void ArrangeElement(UIElement element, bool dispatch)
| Parameter | Type | Description |
|---|---|---|
| element | UIElement | The element. |
| dispatch | bool | if set to |
ArrangeElement(UIElement, Rect?, bool)
Arranges the specified element using the current arrange state.
protected static void ArrangeElement(UIElement element, Rect? finalRect, bool dispatch)
| Parameter | Type | Description |
|---|---|---|
| element | UIElement | The element. |
| finalRect | Rect? | The final rect to use to arrange element; otherwise, |
| dispatch | bool | if set to |
ArrangeElements(IList<UIElement>, Size)
Positions the specified elements and determines a size for a FrameworkElement-derived class.
public abstract Size ArrangeElements(IList<UIElement> elements, Size finalSize)
| Parameter | Type | Description |
|---|---|---|
| elements | IList<UIElement> | The elements to be arranged. |
| finalSize | Size | The final area within the parent that this element should use to arrange itself and the specified elements. |
Returns
- Size:
The actual size used.
ArrangeOverride(Size)
When overridden in a derived class, positions child elements and determines a size for a FrameworkElement derived class.
protected override Size ArrangeOverride(Size finalSize)
| Parameter | Type | Description |
|---|---|---|
| finalSize | Size | The final area within the parent that this element should use to arrange itself and its children. |
Returns
- Size:
The actual size used.
GetArrangeHeightAnimated(UIElement)
Gets the value of the ArrangeHeightAnimatedProperty attached property for the specified object.
public static double GetArrangeHeightAnimated(UIElement element)
| Parameter | Type | Description |
|---|---|---|
| element | UIElement | The element from which the property value is read. |
Returns
GetArrangeRectAnimated(UIElement)
Gets the current arrange rectangle of the specified element based on the animated properties.
public static Rect GetArrangeRectAnimated(UIElement element)
| Parameter | Type | Description |
|---|---|---|
| element | UIElement | The element. |
Returns
- Rect:
The current arrange rectangle of the specified element.
GetArrangeState(UIElement)
Gets the value of the ArrangeStateProperty attached property for the specified object.
public static ArrangeState? GetArrangeState(UIElement element)
| Parameter | Type | Description |
|---|---|---|
| element | UIElement | The element from which the property value is read. |
Returns
GetArrangeWidthAnimated(UIElement)
Gets the value of the ArrangeWidthAnimatedProperty attached property for the specified object.
public static double GetArrangeWidthAnimated(UIElement element)
| Parameter | Type | Description |
|---|---|---|
| element | UIElement | The element from which the property value is read. |
Returns
GetArrangeXAnimated(UIElement)
Gets the value of the ArrangeXAnimatedProperty attached property for the specified object.
public static double GetArrangeXAnimated(UIElement element)
| Parameter | Type | Description |
|---|---|---|
| element | UIElement | The element from which the property value is read. |
Returns
GetArrangeYAnimated(UIElement)
Gets the value of the ArrangeYAnimatedProperty attached property for the specified object.
public static double GetArrangeYAnimated(UIElement element)
| Parameter | Type | Description |
|---|---|---|
| element | UIElement | The element from which the property value is read. |
Returns
GetIsAnimated(UIElement)
Gets the value of the IsAnimatedProperty attached property for the specified object.
public static bool GetIsAnimated(UIElement element)
| Parameter | Type | Description |
|---|---|---|
| element | UIElement | The element from which the property value is read. |
Returns
GetVisualChild(int)
protected override Visual GetVisualChild(int index)
| Parameter | Type | Description |
|---|---|---|
| index | int | The index position of the Visual child. |
Returns
MeasureElements(IList<UIElement>, Size)
Measures the size in layout required for the specified elements and determines a size for the FrameworkElement-derived class.
public abstract Size MeasureElements(IList<UIElement> elements, Size availableSize)
| Parameter | Type | Description |
|---|---|---|
| elements | IList<UIElement> | The elements to be measured. |
| availableSize | Size | The available size that this element can give to the specified elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available. |
Returns
- Size:
The size that this element determines it needs during layout, based on its calculations of the specified elements.
MeasureOverride(Size)
When overridden in a derived class, measures the size in layout required for child elements and determines a size for the FrameworkElement-derived class.
protected override Size MeasureOverride(Size availableSize)
| Parameter | Type | Description |
|---|---|---|
| availableSize | Size | The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available. |
Returns
- Size:
The size that this element determines it needs during layout, based on its calculations of child element sizes.
OnVisualChildrenChanged(DependencyObject, DependencyObject)
Invoked when the VisualCollection of a visual object is modified.
protected override void OnVisualChildrenChanged(DependencyObject visualAdded, DependencyObject visualRemoved)
| Parameter | Type | Description |
|---|---|---|
| visualAdded | DependencyObject | The Visual that was added to the collection. |
| visualRemoved | DependencyObject | The Visual that was removed from the collection. |
SetArrangeHeightAnimated(UIElement, double)
Sets the value of the ArrangeHeightAnimatedProperty attached property to the specified object.
public static void SetArrangeHeightAnimated(UIElement element, double value)
| Parameter | Type | Description |
|---|---|---|
| element | UIElement | The element to which the attached property is written. |
| value | double | The value to set. |
SetArrangeState(UIElement, ArrangeState?)
Sets the value of the ArrangeStateProperty attached property to the specified object.
public static void SetArrangeState(UIElement element, ArrangeState? value)
| Parameter | Type | Description |
|---|---|---|
| element | UIElement | The element to which the attached property is written. |
| value | ArrangeState | The value to set. |
SetArrangeWidthAnimated(UIElement, double)
Sets the value of the ArrangeWidthAnimatedProperty attached property to the specified object.
public static void SetArrangeWidthAnimated(UIElement element, double value)
| Parameter | Type | Description |
|---|---|---|
| element | UIElement | The element to which the attached property is written. |
| value | double | The value to set. |
SetArrangeXAnimated(UIElement, double)
Sets the value of the ArrangeXAnimatedProperty attached property to the specified object.
public static void SetArrangeXAnimated(UIElement element, double value)
| Parameter | Type | Description |
|---|---|---|
| element | UIElement | The element to which the attached property is written. |
| value | double | The value to set. |
SetArrangeYAnimated(UIElement, double)
Sets the value of the ArrangeYAnimatedProperty attached property to the specified object.
public static void SetArrangeYAnimated(UIElement element, double value)
| Parameter | Type | Description |
|---|---|---|
| element | UIElement | The element to which the attached property is written. |
| value | double | The value to set. |
SetIsAnimated(UIElement, bool)
Sets the value of the IsAnimatedProperty attached property to the specified object.
public static void SetIsAnimated(UIElement element, bool value)
| Parameter | Type | Description |
|---|---|---|
| element | UIElement | The element to which the attached property is written. |
| value | bool | The value to set. |
Fields
AnimationCountProperty
Defines the AnimationCount property.
public static readonly DependencyProperty AnimationCountProperty
AreLeavingElementsAnimatedProperty
Defines the AreLeavingElementsAnimated property.
public static readonly DependencyProperty AreLeavingElementsAnimatedProperty
ArrangeAnimationProperty
Defines the ArrangeAnimation property.
public static readonly DependencyProperty ArrangeAnimationProperty
ArrangeHeightAnimatedProperty
Defines the ArrangeHeightAnimated property.
public static readonly DependencyProperty ArrangeHeightAnimatedProperty
ArrangeStateProperty
Defines the ArrangeState property.
public static readonly DependencyProperty ArrangeStateProperty
ArrangeWidthAnimatedProperty
Defines the ArrangeWidthAnimated property.
public static readonly DependencyProperty ArrangeWidthAnimatedProperty
ArrangeXAnimatedProperty
Defines the ArrangeXAnimated property.
public static readonly DependencyProperty ArrangeXAnimatedProperty
ArrangeYAnimatedProperty
Defines the ArrangeYAnimated property.
public static readonly DependencyProperty ArrangeYAnimatedProperty
IsAnimatedProperty
Defines the IsAnimated property.
public static readonly DependencyProperty IsAnimatedProperty
IsLayoutUpdatePendingProperty
Defines the IsLayoutUpdatePending property.
public static readonly DependencyProperty IsLayoutUpdatePendingProperty