Skip to content

Implemented shorthand syntax for ColumnDefinitions and RowDefinitions#10317

Closed
himgoyalmicro wants to merge 14 commits into
dotnet:mainfrom
himgoyalmicro:GridShorthandXamlSyntax
Closed

Implemented shorthand syntax for ColumnDefinitions and RowDefinitions#10317
himgoyalmicro wants to merge 14 commits into
dotnet:mainfrom
himgoyalmicro:GridShorthandXamlSyntax

Conversation

@himgoyalmicro
Copy link
Copy Markdown
Contributor

@himgoyalmicro himgoyalmicro commented Jan 20, 2025

Implements #9802

Description

It will simplify the definition syntax of RowDefinitions and ColumnDefinitions by:

  • Allowing rows and columns within a Grid to be defined by a collection that is delimited by comma and space
  • Creating a Typeconvertor for ColumnDefinitionCollection and RowDefinitionCollection so they can process String as its input.

Decoupled RowDefinitionCollection and ColumnDefinitionCollection from the owner grid to ensure VS Hot Reload functionality remains intact.

Customer Impact

This feature will make Grid markup less verbose, allowing developers to create grids with simpler syntax.

Regression

N/A

Testing

Local build pass

Risk

Low

Microsoft Reviewers: Open in CodeFlow

Copy link
Copy Markdown
Member

@h3xds1nz h3xds1nz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through this rather quickly, I believe it was otherwise tested and nothing seems to strike me as wrong besides the repeating null-checks in the same method, so just adding my nits/code-style pretty much.

Comments apply always to both collections as they're the same.

}
set
{
if (value?.Owner == this)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably put the whole setter into a method; however the main thing is I'd refactor the triple null check in this procedure, you should only need to check for whether value is null once here.

@godlytalias
Copy link
Copy Markdown

Please update description to give overview on the older format as well

@himgoyalmicro
Copy link
Copy Markdown
Contributor Author

Closing in favor of #10866

@github-actions github-actions Bot locked and limited conversation to collaborators Jun 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

draft PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants