Added BorderThickness attached DP for outlined date/time pickers #2805
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.
Fix for #2737
This PR introduces 2 new assists types (
DatePickerAssist
andTimePickerAssist
) which both contain attached DPs which can be used to set the inactive and activeBorderThickness
on theDatePicker
/TimePicker
using the outlined styles (MaterialDesignOutlinedDatePicker
/MaterialDesignOutlinedTimePicker
). "Inactive" is when there is no mouse/keyboard interaction with the element, and "Active" is when the element is either hovered or has keyboard focus.For the
TimePicker
, I could have just added the new attached DPs directly as normal DPs on theTimePicker
type, but since the properties only apply for the outlined style, I thought it was better to keep them in aTimePickerAssist
type.I updated the demo app to include some samples of this because using
Thickness
values that vary from the default values may require the caller to also set theHintAssist.FloatingOffset
in order for the hint to be correctly placed.The
IMultiValueConverter
that I added is needed to calculate a "margin diff" which ensures the UI does not "jump" between the inactive/active states. This was previously hardcoded to -1 because the of the defaults being inactive=1 and active=2.NOTE: In the UI tests I have left a TODO because I would have liked to be able to mark a
ValidationError
on the containedTextBox
without too much overhead. Perhaps this is something that could be added as a feature in XAMLTest? For now, the tests include an actualValidationRule
and the value is changed during the test to force the validation error. I added a PR with proof-of-concept for this in the XAMLTest project.