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

Allow accessing BindingExpressions to make proper use of UpdateSourceTrigger=Explicit #14965

Closed
timschneeb opened this issue Mar 13, 2024 · 4 comments · Fixed by #16214
Closed

Comments

@timschneeb
Copy link
Contributor

timschneeb commented Mar 13, 2024

Is your feature request related to a problem? Please describe.

I'm trying to use the new UpdateSourceTrigger=Explicit parameter for some bindings.

At the moment, I can't seem to find a way to access BindingExpressions for existing bindings defined in XAML, but I need that to call BindingExpressionBase.UpdateSource.

Describe the solution you'd like

WPF has a public API to retrieve binding expressions:

control.GetBindingExpression(Control.TargetProperty)

Maybe something similar could be implemented.

Describe alternatives you've considered

--

Additional context

#13734 also requested this functionality, and although it was closed, there doesn't seem to be any public API for that particular use case yet.

@timunie
Copy link
Contributor

timunie commented Mar 13, 2024

@ThePBone which version did you test? 11.1 beta may have that API now

@timschneeb
Copy link
Contributor Author

I tested 11.1 beta-1.
UpdateSourceTrigger.Explicit and BindingExpressionBase.UpdateSource are available as mentioned in PR #13970.
However, I don't think there is currently a way to obtain a reference to a BindingExpressionBase for an existing binding using the public API, so the UpdateSource method can't actually be accessed, as far as I can see.

@timunie
Copy link
Contributor

timunie commented Mar 14, 2024

@ThePBone I think you are right. Most likely an oversight

/cc @grokys

@geferon
Copy link

geferon commented Mar 27, 2024

Any idea when this will be added? I find myself in need of being able to access the binding(s) of a control

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants