问题描述
在WPF中,UpdateSourceTrigger对每个控件都有不同的默认值,它们无法设置一些可以控制所有元素如何设置UpdateSourceTrigger的内容!您可以定义创建一个可以通过页面并更改所有值的附加行为。
< Window
local:DefaultUpdateSourceTrigger =PropertyChanged>
< / Window>
然后可以走视觉树并更改UpdateSourceTriggers!
In XAML (or code) is there a way to default the UpdateSourceTrigger to PropertyChanged for all bindings?
http://msdn.microsoft.com/en-us/library/system.windows.data.binding.updatesourcetrigger.aspx
http://msdn.microsoft.com/en-us/library/system.windows.data.updatesourcetrigger.aspx
In WPF, the UpdateSourceTrigger has diffeent default values for each control and their is no way of setting something that will control how all the elements set their UpdateSourceTrigger! You can definetely create a attached behavior that can go thru a page and change all the values?
<Window
local:DefaultUpdateSourceTrigger="PropertyChanged">
</Window>
This can then walk the visual tree and change the UpdateSourceTriggers!
这篇关于在XAML中有一种默认UpdateSourceTrigger到PropertyChanged的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!