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

Add a possibility to refresh a binding from the code-behind. #13734

Closed
VladiStep opened this issue Nov 25, 2023 · 3 comments · Fixed by #13970
Closed

Add a possibility to refresh a binding from the code-behind. #13734

VladiStep opened this issue Nov 25, 2023 · 3 comments · Fixed by #13970

Comments

@VladiStep
Copy link
Contributor

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

In WPF, it's possible to do something like this: textBlock.GetBindingExpression(TextBlock.TextProperty).UpdateSource().
But it seems you can't do that in AvaloniaUI.

Describe the solution you'd like

There should be some alternative to the WPF method I described.

Describe alternatives you've considered

I guess it's needed to rework an existing internal BindingExpression class so that you can get it for a property and then call UpdateSource() on it.

@VladiStep VladiStep changed the title Add a possibility to refresh binding from the code-behind. Add a possibility to refresh a binding from the code-behind. Nov 25, 2023
@maxkatz6
Copy link
Member

There is no UpdateSourceTrigger=Explicit support yet, and this API doesn't make sense without it.
But it is planned bee98ad#diff-ccfdf6768edfce7a5cf7bb4a103e15abeeb53ba684bf457df6d52d3f61a9cdb2

@timunie
Copy link
Contributor

timunie commented Nov 27, 2023

Avalonia.Behviors may be useful for the time beeing. See: #3754 (comment)

@grokys
Copy link
Member

grokys commented Nov 28, 2023

I'm currently working in a binding refactor which includes this feature. It's not quite ready for a PR yet but the brach is refactor/bindings.

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.

4 participants