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.
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
Column | Gets or sets the number of column in UXGridPanel. |
GridMode | Gets or sets the grid mode. |
ItemHeight | Gets or sets the height of the item. |
ItemMargin | Gets or sets the outer margin of the item. |
ItemWidth | Gets or sets the width of the item. |
Latency | Gets or sets a value that determine the latency before the item collection is re-adjusted when an item is inserted, moved or removed. |
Orientation | Gets or sets the fill orientation. |
RenderColumn | Gets the number or rendered column. |
RenderRow | Gets the number of rendered row. |
Row | Gets or sets the number of row in UXGridPanel. |
Protected Properties
Product | Product Info. |
Fields
ColumnProperty | Identifies the Column dependency property. |
GridModeProperty | Identifies the GridMode dependency property. |
ItemHeightProperty | Identifies the ItemHeight dependency property. |
ItemMarginProperty | Identifies the ItemMargin dependency property. |
ItemWidthProperty | Identifies the ItemWidth dependency property. |
LatencyProperty | Identifies the Latency dependency property. |
OrientationProperty | Identifies the Orientation dependency property. |
RowProperty | Identifies 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
index | Index. |
element | Element. |
public void MoveChild(int currentIndex, int targetIndex)
Move the element from current index to target index.
Parameters
currentIndex | Current index. |
targetIndex | Target index. |
public void RemoveChild(UIElement child)
Removed the UIElement from UXPanel.
Parameters
child | Element that going to be removed. |
public void RemoveChild(int index)
Removed the UIElement at indext position from UXPanel.
Parameters
index | The 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
finalSize | The 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
availableSize | The 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. |