Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grid Shorthand Syntax Implementation #6
base: release/9.0
Are you sure you want to change the base?
Grid Shorthand Syntax Implementation #6
Changes from 4 commits
7a5aa07
61376b0
5cab537
f14d5e3
56975ef
f4f03c8
3af704d
bd9984b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it makes sense to have create base type converter for code shared between Rows and Columns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They don't really have any properties in common, the code would have to be split anyway even if it was a single converter. And I would rather have two standalone converters than one relying on type descriptor to figure out what the converter should produce.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @miloush here, there is very less commonality between the two properties and we would need to bifurcate the code to handle the properties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why type converter is applied to
ColumnDefinitions
property rather thanclass ColumnDefinitionCollection
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would find that a higher risk, as it would affect uses outside of the Grid (and would get returned by TypeDescriptor). The main reason I would be reluctant to do so is because the converter does not really support converting the whole collection. It supports only quite a narrow albeit common case where properties like MinWidth, MaxWidth, Offset or SharedSizeGroup are not set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also a discussion that for that reason, the converter might only support conversion from string, not to string.
(And type converter applied to a property was an important distinguishing factor for the XAML parser to allow manipulating collections using attribute, though with public setter we have departed from that requirement.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to remove the definitions from the parent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, Clear() does that internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why initialize _data if value is null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this throws when the definition is already the correct owner/parent
e.g.
grid.ColumnDefinitions = grid.ColumnDefinitions
would throw and shouldn'tThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah except you clear everything first and then readd it.