Avoid unnecessary final measure call on Auto/Auto cell #6637
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
Proposing this as an alternative to #6542. This version doesn't require special-casing the button image and invalidating the parent.
The Button Image behavior described in #5601 only happens if the layout is a Grid and the Button is in a cell with Auto/Auto for the sizing. This is happening because the Button is receiving unneeded extra measurement calls at the specific default size determined for the Auto/Auto cell before the actual image has been loaded, and the internal bookkeeping for the MAUIButton doesn't think it needs to invalidate its layout once the image is loaded.
This change eliminates the extra measure call in that situation (and, as a bonus, skips that duplicate measure call in general).
Issues Fixed
Fixes #5601