Height and Width
All FrameworkElement
s have simple Height
and Width
properties (of type double
), and they also have MinHeight
, MaxHeight
, MinWidth
, and MaxWidth
properties that can be used to specify a range of acceptable values. Any or all of these can be easily set on elements in procedural code or in XAML.
An element naturally stays as small as possible, so if you use MinHeight
or MinWidth
, it is rendered at that height/width unless its content forces it to grow. In addition, that growth can be limited by using MaxHeight
and MaxWidth
(as long as these values are larger than their Min
counterparts). When using an explicit Height
and Width
at the same time as their Min
and Max
counterparts, Height
and Width
take precedence as long as they are ...
Get XAML Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.