An attached property lets one object provide metadata for another. In .NET MAUI, Grid.Row and Grid.Column place controls within a Grid without making those properties ordinary Button or Label properties. section 5.1.2
Use attached properties when positioning views in a Grid:
- Count rows and columns from zero: row 0 is the top, and column 0 is the left. section 5.1.2
- Set Grid.Row and Grid.Column directly on any view placed in the Grid. section 5.1.2
- Use Grid.ColumnSpan when a view, such as a display, should extend across multiple columns. section 5.1.2
Place a button in a Grid
A Button with Grid.Row="2" and Grid.Column="1" occupies the third row and second column. A calculator can reserve row 0 for its display and place buttons in later rows. section 5.1.2
<Button Grid.Row="2"
Grid.Column="1"
Text="Click me!" />
Inspect the minimal XAML example showing an attached property on a Button. section 5.1.2
