simpler RowDefinitions

Jassim Al Rahma 1,521 Reputation points
2023-03-21T18:17:39.2066667+00:00

Hi,

I have the following

RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"

How can I make it simpler to have 12 Auto Rows?

Thanks,

Jassim

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,859 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 35,291 Reputation points Microsoft Vendor
    2023-03-23T09:24:14.4733333+00:00

    Hello,

    According to the official documentation, if the Grid.Row or Gird.Column property is used without the auto label, its default value is *.

    The default value of the RowDefinition.Height property is *. Similarly, the default value of the ColumnDefinition.Width property is *. Therefore, it's not necessary to set these properties in cases where these defaults are acceptable.

    Therefore, if you want to use the auto attribute, you need to set it manually in the Gird tag, and according to this document Simplify row and column definitions, the way you use is already the most simplified way to declare rows and columns.

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments