Skip to content

Latest commit

 

History

History
40 lines (24 loc) · 2.52 KB

frameworkelement_maxheight.md

File metadata and controls

40 lines (24 loc) · 2.52 KB
-api-id -api-type
P:Windows.UI.Xaml.FrameworkElement.MaxHeight
winrt property

Windows.UI.Xaml.FrameworkElement.MaxHeight

-description

Gets or sets the maximum height constraint of a FrameworkElement.

-xaml-syntax

<frameworkElement MaxHeight="double"/>
 

-property-value

The maximum height of the object, in pixels. The default value is PositiveInfinity. This value can be any value equal to or greater than 0. PositiveInfinity is also valid.

-remarks

MaxHeight is one of three writable properties on FrameworkElement that specify height information. The other two are Height and MinHeight. If there is a conflict between these values, the order of application for actual height determination is that first MinHeight must be honored, then MaxHeight, and finally, if it is within bounds, Height. All of these properties are recommendations to the layout behavior of the element's parent in the object tree. The height of the object after layout runs is available as the ActualHeight property value.

The final ActualHeight of an element might exceed MaxHeight. For example, if UseLayoutRounding is set to true and your app is running on a display with a Resolution Scale greater than 100%, then the ActualHeight may be rounded up to help ensure your UI doesn't look blurry when scaled.

-examples

This XAML example shows a technique of specifying a MaxHeight for a ViewBox. ViewBox is a decorator that can apply layout information to a single child and divide layout areas for the next parent element (in this case a StackPanel).

[!code-xamlViewBoxXAML]

-see-also

ActualHeight, Height, MinHeight, Define layouts with XAML