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

Implemented MultiBindingExpression #16219

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

grokys
Copy link
Member

@grokys grokys commented Jul 3, 2024

What does the pull request do?

Implements MultiBindingExpression and makes MultiBinding use it instead of relying on the now-obsolete APIs it was using before.

Shouldn't have much user-facing effect, though does allow us to fix #16084

Also removes a couple of usages of the obsolete IBinding.Initiate API from multi-binding tests and adds nullable annotations to that file.

Fixed issues

Fixes #16084

- Swap `target` and `targetProperty` order to make it consistent with other similar methods
- Make `targetProperty` nullable as it will need to be null for `MultiBinding`
It will need to be null for `MultiBinding`.
It will need to be null for `MultiBinding`.
Only publish unset value if we've already published a value.
@grokys grokys added enhancement backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Jul 3, 2024
@grokys grokys requested a review from MrJul July 3, 2024 13:24
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0049768-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0049776-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

converted = _targetNullValue;
if (converted == AvaloniaProperty.UnsetValue)
converted = _fallbackValue;
PublishValue(converted);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to handle BindingOperations.DoNothing anymore: DoNothing is directly published to the target.

MultiValueConverterTests is supposed to check this but the test passes for the wrong reason, because DoNothingType isn't convertible to the target string type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change in MultiBinding behaviour in 11.1.0-rc1 compared to 11.0.11
3 participants