DataSourceUpdateMode DataSourceUpdateMode DataSourceUpdateMode DataSourceUpdateMode Enum

定义

指定绑定控件中发生更改后更新数据源的时间。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
继承
DataSourceUpdateModeDataSourceUpdateModeDataSourceUpdateModeDataSourceUpdateMode

字段

Never Never Never Never 2

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

OnPropertyChanged OnPropertyChanged OnPropertyChanged OnPropertyChanged 1

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

OnValidation OnValidation OnValidation 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.

备注

即使更新模式设置为 Never,首次创建绑定,以便在至少一个更新将始终在发生时将更新数据源。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.

适用于