In This Article


This panel allows child elements to be positioned in sequential order, either horizontally or vertically.



This panel can be used as a drop-in replacement for the native StackPanel panel.


Child elements are positioned or "stacked" based on the order that the elements were added to the panel, or more specifically, their position in the Children collection. Elements can be stacked either vertically or horizontally, which is determined by the AnimatedStackPanel.Orientation property.


AnimatedStackPanel with the elements stacked vertically (left) and horizontally (right)

Like the native WPF StackPanel, the AnimatedStackPanel implents IScrollInfo to support logical scrolling. Physical scrolling is based on the size of the element being scrolled and can be thought of as "pixel-based" scrolling. Logical scrolling is based on the number of elements in the AnimatedStackPanel, so it effectively moves a given element completely into the view (when possible). If ScrollViewer.CanContentScroll is set to false, then logical scrolling will be disabled and physical scrolling will be used.

Getting Started with AnimatedStackPanel

This code shows typical XAML code used to position elements in an AnimatedStackPanel:

<views:AnimatedStackPanel Orientation="Vertical">
	<Button Content="One" \>
	<!-- Positioned just below the button above -->
	<Button Content="Two" \>

Important Members

The following AnimatedStackPanel members are key to its use:

Member Description
Orientation Property Gets or sets the orientation that the child elements are arranged.