VisualElement.OnSizeRequest(Double, Double) VisualElement.OnSizeRequest(Double, Double) Method

Definition

Warning

This API is now obsolete.

This method is called during the measure pass of a layout cycle to get the desired size of an element.

[System.Obsolete("OnSizeRequest is obsolete as of version 2.2.0. Please use OnMeasure instead.")]
protected virtual Xamarin.Forms.SizeRequest OnSizeRequest (double widthConstraint, double heightConstraint);
abstract member OnSizeRequest : double * double -> Xamarin.Forms.SizeRequest
override this.OnSizeRequest : double * double -> Xamarin.Forms.SizeRequest
Parameters
widthConstraint
Double Double

The available width for the element to use.

heightConstraint
Double Double

The available height for the element to use.

Returns

A SizeRequest which contains the desired size of the element.

Remarks

The results of this method will be (-1, -1) if the element has not yet been realized with a platform specific backing control. Overriding this method does not require a call to the base class so long as a valid SizeRequest is returned.

Applies to