VisualElement.Measure(Double, Double, MeasureFlags) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for