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

Propagate HintAssist.Background into TimePicker and DatePicker #3367

Merged
merged 3 commits into from
Nov 21, 2023
Merged

Conversation

nicolaihenriksen
Copy link
Contributor

Should eventually fix #3365

This PR originates from a discussion topic where a MDIX consumer was trying to set HintAssist.Background for the TimePicker but the value was not propagating through.

The PR now propagates the value through and is applied as the background of the Border containing the hint. The background property has always been set to the value of the attached property, but it has just never been propagated through and therefore had no effect. Because the background setter is using the attached property, my assumption is that the original intention has been to propagate it through.

The OP of the discussion topic needed it for the outlined style, but I assume it should be applied for all the styles.

It does, in my opinion, look somewhat wacky, but at least there is now an opt-in opportunity to actually change it if you so desire. Note that there is also an opacity difference between the styles. I am wondering whether that is desirable.

Also note that there is special handling of the outlined style when the hint is floating. For the "standard" control it changes from Transparent to the theme background color in order to "mask out" the outline which it covers. I had to introduce a converter to make sure this only falls back to the theme background in the case where the attached property is set to its default value. Any other value than the default will not cause a fallback to the theme background. I also added special UI tests covering this particular case (both default and non-default).

TimePickerHintBackground

@nicolaihenriksen nicolaihenriksen marked this pull request as ready for review November 21, 2023 20:12
@Keboo Keboo merged commit cb08b95 into master Nov 21, 2023
2 checks passed
@Keboo Keboo deleted the fix3365 branch November 21, 2023 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't change Hint background of TimePicker without hijacking the style.
2 participants