Skip to content

Allow specifying BindingMode in AncestorBinding #1384

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ProphetLamb
Copy link

@ProphetLamb ProphetLamb commented Apr 30, 2025

GitHub Issue (If applicable): #

PR Type

What kind of change does this PR introduce?

What is the current behavior?

AncestorBinding always binds using BindingMode.OneWay.

What is the new behavior?

AncestorBinding always binds using BindingMode.OneWay unless specified otherwise.
AncestorBinding allows specifying a desired Mode diverging from the default behaviour.
This change is non-breaking.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

I've been using a copy of AncestorBinding with this change for a while. Thought I'd contribute it, if wanted.
Tests for mobile platforms are pending, because I'm developing for Web & Desktop only.

Internal Issue (If applicable):

@CLAassistant
Copy link

CLAassistant commented Apr 30, 2025

CLA assistant check
All committers have signed the CLA.

@kazo0
Copy link
Contributor

kazo0 commented May 1, 2025

Nice! Thank you for the PR @ProphetLamb! And for the added tests, very much appreciated :)

Will ping @Xiaoy312 to double-check this just in case :)

Copy link
Contributor

@Xiaoy312 Xiaoy312 left a comment

Choose a reason for hiding this comment

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

other than the testing part, the rest is good
thanks for contributing

Copy link
Contributor

Choose a reason for hiding this comment

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

the newly added doesnt verify the nature of the binding (being two-ways)
you should either retrieve the binding on the property and assert its mode, or
change the destination value and validate if the source value is updated as a result
preferably both

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.

4 participants