[]
        
(Showing Draft Content)

C1.WPF.Schedule.AutoDistributionGrid

AutoDistributionGrid Class

Represents a grid panel that automatically distributes child elements among grid cells.

Inheritance
AutoDistributionGrid
Namespace: C1.WPF.Schedule
Assembly: C1.WPF.Schedule.dll
Syntax
public class AutoDistributionGrid : Grid, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild
Remarks

The AutoDistributionGrid class provides the following additional functionality to the base Grid class.

  • Scatters child elements by rows or columns depending on the ChildrenFlowDirection property value, with an ability to change a default placement for any child element by specifying the DistributionInfo objects in the ChildrenDistributionInfo collection.
  • Introduces the settable and bindable RowCount and ColumnCount properties that allows defining of row and column count numerically, without adding/removing items in the Grid.RowDefinitions/ColumnDefinitions collections. Along with the introduced bindable VisualChildCount property it gives, for example, an ability to have as many rows as you have children.
  • Gives an ability to automatically keeps a number of column and rows so as cells with a fixed width and/or height fully fit in the AutoDistributionGrid size. This is controlled by the FitCellsOfWidth and FitCellsOfHeight properties.

Constructors

Name Description
AutoDistributionGrid()

Creates a new instance of AutoDistributionGrid.

Fields

Name Description
CellCountProperty

Identifies the CellCount dependency property.

ChildrenFlowDirectionProperty

Identifies the ChildrenFlowDirection dependency property.

ColumnCountProperty

Identifies the ColumnCount dependency property.

FitCellsOfHeightProperty

Identifies the FitCellsOfHeight dependency property.

FitCellsOfWidthProperty

Identifies the FitCellsOfWidth dependency property.

RowCountProperty

Identifies the RowCount dependency property.

VisualChildCountProperty

Identifies the VisualChildCount dependency property.

Properties

Name Description
CellCount

Gets a number of cells in the AutoDistributionGrid. This is a dependency property.

ChildrenDistributionInfo

Gets a collection of DistributionInfo objects that allows to redefine a default placement of a certain child element.

ChildrenFlowDirection

Gets or sets a value that determines a flow direction of child elements in the AutoDistributionGrid. The default value is Horizontal. This is a dependency property.

ColumnCount

Gets or sets a value that determines a number of columns in the AutoDistributionGrid. This is a dependency property.

FitCellsOfHeight

Allows the forcing of the AutoDistributionGrid to generate cells of the specified height, where a number of rows will be automatically adjusted so as to fully fit a maximum number of cells in a current grid height. The default value is NaN. This is a dependency property.

FitCellsOfWidth

Allows the forcing of the AutoDistributionGrid to generate cells of the specified width, where a number of columns will be automatically adjusted so as to fully fit a maximum number of cells in a current grid width. The default value is NaN. This is a dependency property.

RowCount

Gets or sets a value that determines a number of rows in the AutoDistributionGrid. This is a dependency property.

VisualChildCount

Gets a number of child elements of the AutoDistributionGrid. This is a dependency property.

Methods

Name Description
MeasureOverride(Size)

Measures the child elements of a AutoDistributionGrid in anticipation of arranging them during the ArrangeOverride pass.

OnRenderSizeChanged(SizeChangedInfo)

Raises the SizeChanged event, using the specified information as part of the eventual event data.

OnVisualChildrenChanged(DependencyObject, DependencyObject)

Called when the visual children of a AutoDistributionGrid element change.