-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Added Binding.Delay
feature
#16805
base: master
Are you sure you want to change the base?
Added Binding.Delay
feature
#16805
Conversation
You can test this PR using the following package version. |
e4fe009
to
2af8608
Compare
You can test this PR using the following package version. |
2af8608
to
33e777f
Compare
You can test this PR using the following package version. |
33e777f
to
c6d2902
Compare
You can test this PR using the following package version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look good! Just one issue I found:
If compiled bindings are disabled I get a compile-time error:
Unable to resolve suitable regular or attached property Delay on type Avalonia.Markup.Xaml:Avalonia.Markup.Xaml.MarkupExtensions.ReflectionBindingExtension
Looks like you didn't add the new property to ReflectionBindingExtension
too (yes it's a bit crazy that it needs to be added here separately - it's just the way things evolved I guess).
c6d2902
to
e7d8ee0
Compare
You can test this PR using the following package version. |
Updates to binding sources can now be delayed by configuring each binding.
What is the updated/expected behavior with this PR?
The delay feature works in the same way as WPF's. When the target property is changed, a
DispatcherTimer
is started (or restarted) and the source is only updated when the timer elapses.As with WPF, there is no delay when the source is updated via
UpdateSourceTrigger.LostFocus
orBindingExpressionBase.UpdateSource()
. Nor is there a delay whenBindingMode.OneWayToSource
is active and a new source object is provided.Other binding types
MultiBinding
does not support writing back to the source, so does not have aDelay
property.TemplateBinding
could supportDelay
but I didn't implement it there. WPF's equivalent type doesn't have it, and I also don't see a use case within the context of aControlTemplate
.Breaking changes
None
Obsoletions / Deprecations
None
Fixed issues
Fixes #7380