UniformGrid.MeasureOverride Method

Computes the desired size of the UniformGrid by measuring all of the child elements.

Namespace:  System.Windows.Controls.Primitives
Assembly:  PresentationFramework (in PresentationFramework.dll)

protected override Size MeasureOverride(
	Size constraint
)

Parameters

constraint
Type: System.Windows.Size
The Size of the available area for the grid.

Return Value

Type: System.Windows.Size
The desired Size based on the child content of the grid and the constraint parameter.

The constraint parameter defines the maximum amount of space that is available for the grid. This space is divided up equally based on the number of rows and columns in the grid. The size of each child is measured to determine the maximum width of all the child elements of the grid. The maximum values cannot exceed the maximum cell size that is computed from the constraint. A desired grid Size is computed based on the maximum child dimensions. The Width is the maximum child width multiplied by the number of columns. The Height is the maximum child height multiplied by the number of rows. This method returns the desired Size.

For example, if there are two rows and four columns in a grid, the maximum height for each cell is 0.5*constraintHeight and the maximum width is 0.25*constraintWidth. For these calculations, constraintHeight is the Height value of the constraint parameter and constraintWidth is the Width value of the constraint parameter.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft