Share via


VisualElement.WidthRequest Property

Definition

Gets or sets the desired width override of this element in device-independent units. This is a bindable property.

public:
 property double WidthRequest { double get(); void set(double value); };
public double WidthRequest { get; set; }
member this.WidthRequest : double with get, set
Public Property WidthRequest As Double

Property Value

The desired width in device-independent units (DIUs), or -1 if unset.

Remarks

The default value is -1, which means the value is unset and a width will be determined automatically.

WidthRequest does not immediately change the Bounds of an element; setting the WidthRequest will change the resulting width of the element during the next layout pass.

Device-independent units (DIUs) provide a consistent unit of measurement across different screen densities. One device-independent unit equals one pixel on a 96-DPI display.

Applies to