Skip to end of metadata
Go to start of metadata

Remarks

UXStackPanel is a stack panel with sophisticated drag-drop features. It implements fluid animation, a built-in UX feature that shows smooth movement when the children of the UXStackPanel is being moved, removed or added.

Working with Orientation Property

The following example demonstrates how to use a UXStackPanel to create a set of vertically-positioned buttons. For horizontal positioning, set the Orientation property to Horizontal.

XAML

Working with Sensitivity Property

In a standard drag and drop experience, you move an element half way of its actual dimension to start reordering the element. This is determined by the Sensitivity property (default value is 0.5).

If you change the Sensitivity property to 0.3, you need to move the element a little bit further until it reach the yellow area.

Note that if you are moving the element from right to left direction, you need to move it until the left yellow area and vice versa.

Definition

public class UXStackPanel : UXPanel, IStackPanel

Summary

The following table summarizes the members exposed in this class.

Public Constructors

UXStackPanel Constructor()Initializes a new instance of the UXStackPanel class.

Public Properties

OrientationGets or sets the dimension by which child elements are stacked.
SensitivityGets or sets a value that determine the distance between drag item and the nearest item that triggered the move action.

Protected Properties

ProductProduct Info.

Fields

OrientationPropertyIdentifies the Orientation dependency property.
SensitivityPropertyIdentifies the Sensitivity dependency property.

Public Methods

AddChild(int, FrameworkElement)Add new element into specified index.
MoveChild(int, int)Move the element from current index to target index.
RemoveChild(UIElement)Removed the UIElement from UXPanel.
RemoveChild(int)Removed the UIElement at indext position from UXPanel.

Protected Methods

ArrangeOverride(Size)Provides the behavior for the Arrange pass of Silverlight layout.
MeasureOverride(Size)Provides the behavior for the Measure pass of Silverlight layout.

Public Constructors

public UXStackPanel()

Initializes a new instance of the UXStackPanel class.

Public Properties

public Orientation Orientation { get; set; }

Gets or sets the dimension by which child elements are stacked.

Remarks

UXStackPanel enables you to stack elements in an assigned direction. The default stack direction is horizontal. The Orientation property can be used to control content flow.

 

public double Sensitivity { get; set; }

Gets or sets a value that determine the distance between drag item and the nearest item that triggered the move action.

Protected Properties

protected ProductInfo Product { get; }

Product Info.

Fields

public static readonly DependencyProperty OrientationProperty

Identifies the Orientation dependency property.

public static readonly DependencyProperty SensitivityProperty

Identifies the Sensitivity dependency property.

Public Methods

public void AddChild(int index, FrameworkElement element)

Add new element into specified index.

Parameters

indexIndex.
elementElement.

 

public void MoveChild(int currentIndex, int targetIndex)

Move the element from current index to target index.

Parameters

currentIndexCurrent index.
targetIndexTarget index.

 

public void RemoveChild(UIElement child)

Removed the UIElement from UXPanel.

Parameters

childElement that going to be removed.

 

public void RemoveChild(int index)

Removed the UIElement at indext position from UXPanel.

Parameters

indexThe index that hold the element that going to be removed.

 

Protected Methods

protected Size ArrangeOverride(Size finalSize)

Provides the behavior for the Arrange pass of Silverlight layout.

Parameters

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

Return Types

The actual size used once the element is arranged.

 

protected Size MeasureOverride(Size availableSize)

Provides the behavior for the Measure pass of Silverlight layout.

Parameters

availableSizeThe available size that this object can give to child objects. Infinity can be specified as a value to indicate that the object will size to whatever content is available.

Return Types

The size that this object determines it needs during layout, based on its calculations of child object allotted sizes.
  • No labels