Refactor SmartHint to allow taking up available space when floated #3041
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.
Fixes #2686
Refactors the SmartHint such that it is allowed to take up the available width of the "container" when the hint is floated. Previously, when the hint was floated, it was the
FloatingHintTextBlockwhich was both moved and scaled down which effectively meant that the "available space" was scaled down with it.This PR changes that "animation" such that the scaling is still applied to the
FloatingHintTextBlockbut the moving of it is done on aCanvaswhich is not scaled down, but simply moved. This allows it to retain its full (available) width.Before the changes, the floating hints that exceeded the available width looked like this when floated (animations slowed down for better overview):
In both of these cases, the hint text is actually longer than what is displayed, but even when space becomes available it does not show.
After the changes, they now look like this:
As can be seen, the text is actually still too long to be fully displayed, but at least it now uses more of the available space. It could be considered to add
TextTrimming="CharacterEllipsis"and perhaps even aToolTip(when truncated) if that is desirable.