Binding.Mode Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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

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


Public Property Mode As BindingMode
public BindingMode Mode { get; set; }
<Binding Mode="bindingModeMemberName"/>

Property Value

Type: System.Windows.Data.BindingMode
One of the BindingMode values. The default is BindingMode.OneWay.


Exception Condition

The Binding has already been attached to a target element, and cannot be modified.


In OneWay or TwoWay bindings, the source object must implement INotifyPropertyChanged in order for the target to update when the source changes.

See Binding Markup Extension to learn how Mode can be set as a binding property through the Binding markup extension, which enables specifying an entire Binding as an attribute string.


The following example demonstrates how to set the binding mode in XAML.

<TextBox x:Name="MyTextBox" Text="Text" Foreground="{Binding Brush1, Mode=OneWay}"/>

Version Information


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0


For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also


Other Resources