VisualElement.Measure(Double, Double, MeasureFlags) Method

Definition

Returns the minimum size that an element needs in order to be displayed on the device.

public virtual Microsoft.Maui.SizeRequest Measure (double widthConstraint, double heightConstraint, Microsoft.Maui.Controls.MeasureFlags flags = Microsoft.Maui.Controls.MeasureFlags.None);
abstract member Measure : double * double * Microsoft.Maui.Controls.MeasureFlags -> Microsoft.Maui.SizeRequest
override this.Measure : double * double * Microsoft.Maui.Controls.MeasureFlags -> Microsoft.Maui.SizeRequest
Public Overridable Function Measure (widthConstraint As Double, heightConstraint As Double, Optional flags As MeasureFlags = Microsoft.Maui.Controls.MeasureFlags.None) As SizeRequest

Parameters

widthConstraint
Double

The suggested maximum width constraint for the element to render.

heightConstraint
Double

The suggested maximum height constraint for the element to render.

flags
MeasureFlags

A value that controls whether margins are included in the returned size.

Returns

The minimum size that an element needs in order to be displayed on the device.

Remarks

If the minimum size that the element needs in order to be displayed on the device is larger than can be accommodated by widthConstraint and heightConstraint, the return value may represent a rectangle that is larger in either one or both of those parameters.

Applies to