.NET MAUI for C# Developers by Jesse Liberty & Rodrigo Juarez

.NET MAUI for C# Developers by Jesse Liberty & Rodrigo Juarez

Author:Jesse Liberty & Rodrigo Juarez
Language: eng
Format: epub
Publisher: Packt
Published: 2023-10-15T00:00:00+00:00


Figure 6.2 – Using auto-sizing

Best practice – minimize use of auto

Microsoft recommends minimizing the use of auto as it is less performant (the layout engine has to perform additional calculations). That being said, at times, it is very useful, especially when the size of the object will be determined at runtime.

We could rewrite the rows shown before as follows:

<Grid ColumnDefinitions="*,*,*" RowDefinitions="*,*,auto,auto,50,auto"

The calculation now would be to find the actual size of the three auto rows and add 50 Device-Independent Units, for the fifth row. Then, we take what is left in the grid size, and divide it equally between the first and second rows. The result is shown in the following figure:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.