SmartHint "hint text" should affect layout width of TextBox, PasswordBox, etc. #3141
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 #3124.
This PR sets a
Width
on theCanvas
containing the hint content which matches the width of the hint. This allows the hint to be a determining factor in the layout width of theTextBox
.The
Canvas
is then wrapped in aGrid
which is used to clip the hint in the case where theTextBox
is limited in width to something narrower than the actual hint (e.g.MaxWidth
set, or something similar). The floating animation (i.e.TranslateTransform
) is then moved out of theCanvas
and into theGrid
instead.To see this in action, check out the branch and go back to commit 77a3d1a which includes a default demo app page which allows you to play with the various options. That demo page was removed in follow up commits as we agreed it was not something that should be in the demo app going forward, but it was good for testing out the fix.