Gets or sets the maximum width constraint of a FrameworkElement.
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.
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).