Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Permalink
docs
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
-api-id -api-type
P:Microsoft.UI.Xaml.FrameworkElement.MaxWidth
winrt property

Microsoft.UI.Xaml.FrameworkElement.MaxWidth

-description

Gets or sets the maximum width constraint of a FrameworkElement.

-xaml-syntax

<frameworkElement MaxWidth="double"/>
 

-property-value

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

-remarks

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

The final ActualWidth of an element might exceed MaxWidth. 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 ActualWidth 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 MaxWidth 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

Width, MinWidth, Define layouts with XAML