Handle setting of DesiredSize in Measure implementations, rather than MeasureOverride #19794
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.
Description of Change
At the moment, anyone creating a custom control is responsible for explicitly setting the value of
DesiredSize
during the measure step. This is confusing for implementers - it's not obvious that this is required. And honestly, it's only required because we didn't handle it in theIView.Measure()
implementations, which would make a lot more sense than forcing everyone to handle it themselves.These changes set the
DesiredSize
value to whatever gets returned fromMeasureOverride()
(which is what all the implementations were already doing).Issues Fixed
Doesn't fix #7613 exactly, because the issue reported there isn't really a bug. But it does make the creation of custom controls based on ContentView much more intuitive.