In This Article

PanelBase Class

Represents the base class for the various animated panels.

public abstract class PanelBase : Panel, DUCE.IResource, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IHaveResources, IQueryAmbient, IAddChild, ILogicalParent, IVisualParent
Inheritance:
System.Object System.Windows.Threading.DispatcherObject System.Windows.DependencyObject System.Windows.Media.Visual System.Windows.UIElement System.Windows.FrameworkElement System.Windows.Controls.Panel Object
Derived:
AnimatedCanvas AnimatedDockPanel AnimatedStackPanel AnimatedWrapPanel FanPanel SwitchPanel ZapPanel
Implements:
ILogicalParent IVisualParent

Constructors

PanelBase()

Initializes a new instance of the PanelBase class.

protected PanelBase()

Properties

AreLeavingElementsAnimated

Gets or sets a value indicating whether elements that are leaving the panel will be automatically animated. This is a dependency property.

public bool AreLeavingElementsAnimated { get; set; }

Property Value

System.Boolean:

true if elements that are leaving the panel will be automatically animated; otherwise, false. The default value is true.

ArrangeAnimation

Gets or sets the IArrangeAnimation that controls the animation of elements when arranging. This is a dependency property.

public IArrangeAnimation ArrangeAnimation { get; set; }

Property Value

IArrangeAnimation:

The IArrangeAnimation that controls the animation of elements when arranging The default value is null.

ArrangeAnimationResolved

Gets resolved IArrangeAnimation that controls the animation of elements when arranging.

public virtual IArrangeAnimation ArrangeAnimationResolved { get; }

Property Value

IArrangeAnimation:

The resolved IArrangeAnimation that controls the animation of elements when arranging

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

Gets a value indicating whether there are any children that are leaving the panel.

public bool HasLeavingChildren { get; }

Property Value

System.Boolean:

true if there are any children that are leaving the panel; otherwise, false.

IsLayoutUpdatePending

Gets a value indicating whether a change to the layout logic has changed and the elements have yet to be arranged. This is a dependency property.

public bool IsLayoutUpdatePending { get; protected set; }

Property Value

System.Boolean:

true if a change to the layout logic has changed and the elements have yet to be arranged; otherwise, false. The default value is false.

LeavingChildren

Gets the children that are currently leaving the panel.

public ReadOnlyCollection<UIElement> LeavingChildren { get; }

Property Value

System.Collections.ObjectModel.ReadOnlyCollection<System.Windows.UIElement>:

The children that are currently leaving the panel.

VisualChildrenCount

Gets the number of child System.Windows.Media.Visual objects in this instance of System.Windows.Controls.Panel.

protected override int VisualChildrenCount { get; }

Property Value

System.Int32

Methods

ArrangeElement(PanelBase, UIElement, Boolean)

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, null.

element System.Windows.UIElement

The element.

dispatch System.Boolean

if set to true then the arrange call will be dispatched.

ArrangeElement(PanelBase, UIElement, Nullable<Rect>, Boolean)

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, null.

element System.Windows.UIElement

The element.

finalRect System.Nullable<System.Windows.Rect>

The final rect to use to arrange element; otherwise, null to use current position.

dispatch System.Boolean

if set to true then the arrange call will be dispatched.

ArrangeElement(UIElement, Boolean)

Arranges the specified element using the current arrange state.

protected static void ArrangeElement(UIElement element, bool dispatch)
Parameter Type Description
element System.Windows.UIElement

The element.

dispatch System.Boolean

if set to true then the arrange call will be dispatched.

ArrangeElement(UIElement, Nullable<Rect>, Boolean)

Arranges the specified element using the current arrange state.

protected static void ArrangeElement(UIElement element, Rect? finalRect, bool dispatch)
Parameter Type Description
element System.Windows.UIElement

The element.

finalRect System.Nullable<System.Windows.Rect>

The final rect to use to arrange element; otherwise, null to use current position.

dispatch System.Boolean

if set to true then the arrange call will be dispatched.

ArrangeElements(IList<UIElement>, Size)

Positions the specified elements and determines a size for a System.Windows.FrameworkElement-derived class.

public abstract Size ArrangeElements(IList<UIElement> elements, Size finalSize)
Parameter Type Description
elements System.Collections.Generic.IList<System.Windows.UIElement>

The elements to be arranged.

finalSize System.Windows.Size

The final area within the parent that this element should use to arrange itself and the specified elements.

Returns

System.Windows.Size:

The actual size used.

ArrangeOverride(Size)

Positions child elements and determines a size for a System.Windows.FrameworkElement-derived class.

protected override Size ArrangeOverride(Size finalSize)
Parameter Type Description
finalSize System.Windows.Size

The final area within the parent that this element should use to arrange itself and its children.

Returns

System.Windows.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 System.Windows.UIElement

The element from which the property value is read.

Returns

System.Double:

The object's value.

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 System.Windows.UIElement

The element.

Returns

System.Windows.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 System.Windows.UIElement

The element from which the property value is read.

Returns

ArrangeState:

The object's value.

GetArrangeWidthAnimated(UIElement)

Gets the value of the ArrangeWidthAnimatedProperty attached property for the specified object.

public static double GetArrangeWidthAnimated(UIElement element)
Parameter Type Description
element System.Windows.UIElement

The element from which the property value is read.

Returns

System.Double:

The object's value.

GetArrangeXAnimated(UIElement)

Gets the value of the ArrangeXAnimatedProperty attached property for the specified object.

public static double GetArrangeXAnimated(UIElement element)
Parameter Type Description
element System.Windows.UIElement

The element from which the property value is read.

Returns

System.Double:

The object's value.

GetArrangeYAnimated(UIElement)

Gets the value of the ArrangeYAnimatedProperty attached property for the specified object.

public static double GetArrangeYAnimated(UIElement element)
Parameter Type Description
element System.Windows.UIElement

The element from which the property value is read.

Returns

System.Double:

The object's value.

GetIsAnimated(UIElement)

Gets the value of the IsAnimatedProperty attached property for the specified object.

public static bool GetIsAnimated(UIElement element)
Parameter Type Description
element System.Windows.UIElement

The element from which the property value is read.

Returns

System.Boolean:

The object's value.

GetVisualChild(Int32)

Gets a System.Windows.Media.Visual child of this System.Windows.Controls.Panel at the specified index position.

protected override Visual GetVisualChild(int index)
Parameter Type Description
index System.Int32

The index position of the System.Windows.Media.Visual child.

Returns

System.Windows.Media.Visual:

A System.Windows.Media.Visual child of the parent System.Windows.Controls.Panel element.

MeasureElements(IList<UIElement>, Size)

Measures the size in layout required for the specified elements and determines a size for the System.Windows.FrameworkElement-derived class.

public abstract Size MeasureElements(IList<UIElement> elements, Size availableSize)
Parameter Type Description
elements System.Collections.Generic.IList<System.Windows.UIElement>

The elements to be measured.

availableSize System.Windows.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

System.Windows.Size:

The size that this element determines it needs during layout, based on its calculations of the specified elements.

MeasureOverride(Size)

Measures the size in layout required for child elements and determines a size for the System.Windows.FrameworkElement-derived class.

protected override Size MeasureOverride(Size availableSize)
Parameter Type Description
availableSize System.Windows.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

System.Windows.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 System.Windows.Media.VisualCollection of a visual object is modified.

protected override void OnVisualChildrenChanged(DependencyObject visualAdded, DependencyObject visualRemoved)
Parameter Type Description
visualAdded System.Windows.DependencyObject

The System.Windows.Media.Visual that was added to the collection.

visualRemoved System.Windows.DependencyObject

The System.Windows.Media.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 System.Windows.UIElement

The element to which the attached property is written.

value System.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 System.Windows.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 System.Windows.UIElement

The element to which the attached property is written.

value System.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 System.Windows.UIElement

The element to which the attached property is written.

value System.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 System.Windows.UIElement

The element to which the attached property is written.

value System.Double

The value to set.

SetIsAnimated(UIElement, Boolean)

Sets the value of the IsAnimatedProperty attached property to the specified object.

public static void SetIsAnimated(UIElement element, bool value)
Parameter Type Description
element System.Windows.UIElement

The element to which the attached property is written.

value System.Boolean

The value to set.

Explicit Interface Implementations

ILogicalParent.AddLogicalChild(Object)

Adds the provided object to the logical tree of this element.

void ILogicalParent.AddLogicalChild(object child)
Parameter Type Description
child System.Object

Child element to be added.

ILogicalParent.RemoveLogicalChild(Object)

Removes the provided object from this element's logical tree. System.Windows.FrameworkElement updates the affected logical tree parent pointers to keep in sync with this deletion.

void ILogicalParent.RemoveLogicalChild(object child)
Parameter Type Description
child System.Object

The element to remove.

IVisualParent.AddVisualChild(Visual)

Defines the parent-child relationship between two visuals.

void IVisualParent.AddVisualChild(Visual child)
Parameter Type Description
child System.Windows.Media.Visual

The child visual object to add to parent visual.

IVisualParent.RemoveVisualChild(Visual)

Removes the parent-child relationship between two visuals.

void IVisualParent.RemoveVisualChild(Visual child)
Parameter Type Description
child System.Windows.Media.Visual

The child visual object to remove from the parent visual.

Fields

AnimationCountProperty

Identifies the AnimationCount dependency property. This field is read-only.

public static readonly DependencyProperty AnimationCountProperty

AreLeavingElementsAnimatedProperty

Identifies the AreLeavingElementsAnimated dependency property. This field is read-only.

public static readonly DependencyProperty AreLeavingElementsAnimatedProperty

ArrangeAnimationProperty

Identifies the ArrangeAnimation dependency property. This field is read-only.

public static readonly DependencyProperty ArrangeAnimationProperty

ArrangeHeightAnimatedProperty

Identifies the ArrangeHeightAnimated dependency property. This field is read-only.

public static readonly DependencyProperty ArrangeHeightAnimatedProperty

ArrangeStateProperty

Identifies the ArrangeState dependency property. This field is read-only.

public static readonly DependencyProperty ArrangeStateProperty

ArrangeWidthAnimatedProperty

Identifies the ArrangeWidthAnimated dependency property. This field is read-only.

public static readonly DependencyProperty ArrangeWidthAnimatedProperty

ArrangeXAnimatedProperty

Identifies the ArrangeXAnimated dependency property. This field is read-only.

public static readonly DependencyProperty ArrangeXAnimatedProperty

ArrangeYAnimatedProperty

Identifies the ArrangeYAnimated dependency property. This field is read-only.

public static readonly DependencyProperty ArrangeYAnimatedProperty

IsAnimatedProperty

Identifies the IsAnimated dependency property. This field is read-only.

public static readonly DependencyProperty IsAnimatedProperty

IsLayoutUpdatePendingProperty

Identifies the read-only IsLayoutUpdatePending dependency property. This field is read-only.

public static readonly DependencyProperty IsLayoutUpdatePendingProperty

Inherited Members

  • System.Object.ToString()
  • System.Object.Equals(System.Object)
  • System.Object.Equals(System.Object, System.Object)
  • System.Object.ReferenceEquals(System.Object, System.Object)
  • System.Object.GetHashCode()
  • System.Object.GetType()
  • System.Object.MemberwiseClone()

Extension Methods