Skip to content
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

Floating watermarks now trigger better #2236

Merged
merged 1 commit into from
Dec 5, 2015
Merged

Floating watermarks now trigger better #2236

merged 1 commit into from
Dec 5, 2015

Conversation

Dotnetifier
Copy link
Contributor

Fixes #2225

List of changes:

  • The PART_FloatingMessageContainer grid is now a ContentControl because the layout system for ContentControl is way simpler and therefore faster. Also, the grid wasn't necessary.
  • The triggers that active the hide/show of the floating watermark are no longer three separate DataTriggers. This system now consists of a MultiDataTrigger with two conditions, which both must be satisfied:
    • Whether the input box should have a floating watermark
    • Whether the input box has text
    • The third one, whether the input box actually has a value for TextBoxHelper.Watermark has been dropped, because there are no 'negative' DataTriggers. This brings me to the next change:
  • The animated property is no longer Height; it is now MaxHeight. If the watermark is not set, the TextBlock will not take any space because it uses an added MetroAutoCollapsingTextBlock style, which is based on MetroTextBlock and will automatically collapse when the text property is empty.

@punker76 punker76 merged commit 1a281c0 into MahApps:master Dec 5, 2015
@punker76
Copy link
Member

punker76 commented Dec 5, 2015

@Dotnetifier thx!

@Dotnetifier Dotnetifier deleted the floating-watermark-fix branch December 5, 2015 15:29
@Dotnetifier
Copy link
Contributor Author

That's fine. I already found a way to solve #2235 when I created this PR, but I'm too much of a git noob to do too many branches and stuff at once 😒

@punker76
Copy link
Member

punker76 commented Dec 5, 2015

@Dotnetifier i solved it while testing your changes :-D

@Dotnetifier
Copy link
Contributor Author

Doesn't that make PART_WatermarkMessage at 471 redundant, if the (floating) watermark responsibility is passed on to PART_EditableTextBox at 451?

@punker76
Copy link
Member

punker76 commented Dec 5, 2015

@Dotnetifier PART_WatermarkMessage is for non editing combobox

@Dotnetifier
Copy link
Contributor Author

@punker76 Ah I see, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants