Mode Property

Binding.Mode Property


Gets or sets a value that indicates the direction of the data flow in the binding.

Namespace:   System.Windows.Data
Assembly:  PresentationFramework (in PresentationFramework.dll)

public BindingMode Mode { get; set; }

Property Value

Type: System.Windows.Data.BindingMode

One of the BindingMode values. The default is Default, which returns the default binding mode value of the target . However, the default value varies for each . In general, user-editable control properties, such as those of text boxes and check boxes, default to two-way bindings, whereas most other properties default to one-way bindings.GTMTGTMT

A programmatic way to determine whether a binds one-way or two-way by default is to get the property metadata of the property using GetMetadata and then check the Boolean value of the BindsTwoWayByDefault property.GTMT

To support OneWay and TwoWay bindings, the underlying data must implement INotifyPropertyChanged. For details, see How to: Implement Property Change Notification.

For TwoWay or OneWayToSource bindings, you can control the target-to-source updates by setting the UpdateSourceTrigger property. For more information, see UpdateSourceTrigger.

For more information on the different binding modes, see Data Binding Overview.

.NET Framework
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
© 2015 Microsoft