WrapGrid.ItemHeight Property


Gets or sets the height of the layout area for each item that is contained in a WrapGrid.

 property double ItemHeight { double get(); void set(double value); };
double ItemHeight();

void ItemHeight(double value);
public double ItemHeight { get; set; }
var double = wrapGrid.itemHeight;
wrapGrid.itemHeight = double;
Public Property ItemHeight As Double
<WrapGrid ItemHeight="double" />

Property Value


The height of the layout area for each item that is contained in a WrapGrid. The default is Double.NaN, which results in the "Auto" layout behavior.


"Auto" layout and Double.NaN

The default value of ItemHeight and ItemWidth is not 0, it is Double.NaN. ItemHeight and ItemWidth support the ability to be an unset "Auto" value. Because ItemHeight and ItemWidth are Double values, Double.NaN is used as a special value to represent this "Auto" behavior. The layout system interprets the "Auto" value to generally mean that the object should be sized to the available size in layout, instead of to a specific pixel value. If you want the "Auto" behavior for an object when it is used in layout, leave ItemHeight and ItemWidth unset at their Double.NaN default value. If you have previously set values and want to reenable the "Auto" behavior with run-time code, set to Double.NaN. In XAML such as templates, you can set attribute values using the string "Auto".


Visual C++ component extensions (C++/CX) doesn't have a constant for NaN, it uses a value, which appears as "-1.#IND" followed by zeros.

Applies to

See also