绑定源更新未触发
本文关键字:更新 绑定 | 更新日期: 2023-09-27 18:35:28
我有一个有效的绑定。图形用户界面将更新。
<DataGridTextColumn Binding="{Binding Path=Value,
NotifyOnTargetUpdated=True,
NotifyOnSourceUpdated=True,
Mode=OneWay}"/>
绑定源对象实现 INotifyPropertyChanged 并且绑定属性是普通的 clr 属性。
Binding.TargetUpdated
事件会触发,但不会触发Binding.SourceUpdated
事件。
例如,以下作品
<EventTrigger RoutedEvent="Binding.TargetUpdated"> ...
但
<EventTrigger RoutedEvent="Binding.SourceUpdated"> ...
不。
如果我在代码或 XAML 中创建绑定,在 Triggers
集合或EventSetter
中使用EventTrigger
,则没有区别。据我所知,该事件只是没有开火。
有谁知道如何生火Binding.SourceUpdated
?
可能是在源更改时触发"目标更新",在目标更改时触发"源更新"?
(@black种马给了我一个关于可能发生的事情的提示,但我希望人们会评论/编辑这是正确还是不正确!