Fix bindings without property path #16729
Merged
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.
What does the pull request do?
This PR fixes bindings that are directly bound to a data context without any property path (e.g.
{Binding}
).#13970 / v11.1 introduced a subtle change:
null
data context is considered unset, whether there's a binding path or not.null
data context is considered unset when there's a binding path, or a validnull
value if there isn't one.While both results make sense, this is a behavioral breaking change from v11.0:
OneTime
bindings when the data context isn't known yet don't work anymore.NullTargetValue
andStringFormat
are being applied to thenull
data context.This PR restores the 11.0 behavior.
Unit tests have been added.
For the rare cases where binding directly to a
null
data context is effectively expected (with aTargetNullValue
set), we could add a new binding option in the future.Fixed issues