DataSourceUpdateMode 枚举


指定绑定控件中发生更改后更新数据源的时间。Specifies when a data source is updated when changes occur in the bound control.

public enum class DataSourceUpdateMode
public enum DataSourceUpdateMode
type DataSourceUpdateMode = 
Public Enum DataSourceUpdateMode


Never 2

永远不更新数据源,且不对输入到控件中的值进行分析、验证或重新格式化。Data source is never updated and values entered into the control are not parsed, validated or re-formatted.

OnPropertyChanged 1

每当控件属性的值更改时都更新数据源。Data source is updated whenever the value of the control property changes.

OnValidation 0

数据源在系统验证控件属性时更新。Data source is updated when the control property is validated. 验证后,控件属性的值也会重格式化。After validation, the value in the control property is also reformatted.


使用Binding对象将控件绑定到数据源时, 可以DataSourceUpdateMode使用枚举来指定对数据源进行更新的时间。When a control is bound to a data source using a Binding object, you can specify when an update to the data source will occur using the DataSourceUpdateMode enumeration.

当更新模式为 "从不" 时, 可以使用WriteValue方法强制更新数据源。When the update mode is Never, you can force the data source to be updated by using the WriteValue method.


即使更新模式设置为 "从不", 在首次创建绑定时, 数据源也会更新, 因此至少会出现一次更新。Even when the update mode is set to Never, the data source will be updated when the binding is first created, so at that least one update will always occur.