Skip to end of metadata
Go to start of metadata

Remarks

UXGridPanel is a uniform grid panel with drag drop capability and fluid adjustment animation when an item is moved, removed or added to the UXGridPanel.

Customizing Layout

All children in a UXGridPanel will be arranged in logical order based on their index. You do not need to set the Grid.Column, or Grid.Row for any of the children since the layout is automatically handled by the panel.

XAML

UXGridPanel has an Orientation property that controls the item arrangement. If it is set to Horizontal, it will fill the column first then the row. Similarly, if it is set to Vertical, it will fill the row first then column.

UXGridPanel used a uniform grid arrangement which means that all children will be placed inside a container that has dimension specified by ItemHeight and ItemWidth property, thus you need to be careful when configuring the size of the children. It is recommended to use auto size for all children in the UXGridPanel.

You can also control the margin between item by customizing the ItemMargin property. It's not necessary to manually change the margin of each child element.

Definition

public class UXGridPanel : UXPanel, IGridPanel

Summary

The following table summarizes the members exposed in this class.

Public Constructors

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

Public Properties

ColumnGets or sets the number of column in UXGridPanel.
GridModeGets or sets the grid mode.
ItemHeightGets or sets the height of the item.
ItemMarginGets or sets the outer margin of the item.
ItemWidthGets or sets the width of the item.
LatencyGets or sets a value that determine the latency before the item collection is re-adjusted when an item is inserted, moved or removed.
OrientationGets or sets the fill orientation.
RenderColumnGets the number or rendered column.
RenderRowGets the number of rendered row.
RowGets or sets the number of row in UXGridPanel.

Protected Properties

ProductProduct Info.

Fields

ColumnPropertyIdentifies the Column dependency property.
GridModePropertyIdentifies the GridMode dependency property.
ItemHeightPropertyIdentifies the ItemHeight dependency property.
ItemMarginPropertyIdentifies the ItemMargin dependency property.
ItemWidthPropertyIdentifies the ItemWidth dependency property.
LatencyPropertyIdentifies the Latency dependency property.
OrientationPropertyIdentifies the Orientation dependency property.
RowPropertyIdentifies the Row 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 UXGridPanel()

Initializes a new instance of the UXGridPanel class.

Public Properties

public int Column { get; set; }

Gets or sets the number of column in UXGridPanel.

public GridMode GridMode { get; set; }

Gets or sets the grid mode.

public double ItemHeight { get; set; }

Gets or sets the height of the item.

public Thickness ItemMargin { get; set; }

Gets or sets the outer margin of the item.

public double ItemWidth { get; set; }

Gets or sets the width of the item.

public double Latency { get; set; }

Gets or sets a value that determine the latency before the item collection is re-adjusted when an item is inserted, moved or removed.

public Orientation Orientation { get; set; }

Gets or sets the fill orientation.

public int RenderColumn { get; set; }

Gets the number or rendered column.

public int RenderRow { get; set; }

Gets the number of rendered row.

public int Row { get; set; }

Gets or sets the number of row in UXGridPanel.

Protected Properties

protected ProductInfo Product { get; }

Product Info.

Fields

public static readonly DependencyProperty ColumnProperty

Identifies the Column dependency property.

public static readonly DependencyProperty GridModeProperty

Identifies the GridMode dependency property.

public static readonly DependencyProperty ItemHeightProperty

Identifies the ItemHeight dependency property.

public static readonly DependencyProperty ItemMarginProperty

Identifies the ItemMargin dependency property.

public static readonly DependencyProperty ItemWidthProperty

Identifies the ItemWidth dependency property.

public static readonly DependencyProperty LatencyProperty

Identifies the Latency dependency property.

public static readonly DependencyProperty OrientationProperty

Identifies the Orientation dependency property.

public static readonly DependencyProperty RowProperty

Identifies the Row 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