Mode property

Binding.Mode property

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


public BindingMode Mode { get; set; }

<Binding Mode="bindingModeMemberName"/>

XAML Values


A named constant from the BindingMode enumeration, such as OneWay.

Property value

Type: BindingMode

One of the BindingMode values. The default is OneWay: the source updates the target, but changes to the target value do not update the source.


For OneWay and TwoWay bindings, dynamic changes to the source don't automatically propagate to the target without providing some support from the source. You must implement the INotifyPropertyChanged interface on the source object so that the source can report changes through events that the binding engine listens for. For C# or Microsoft Visual Basic, implement System.ComponentModel.INotifyPropertyChanged. For Visual C++ component extensions (C++/CX), implement Windows::UI::Xaml::Data::INotifyPropertyChanged.

For TwoWay bindings, changes to the target automatically propagate to the source, except if the binding target is the TextBox.Text property. In that case, the update happens only when the TextBox loses focus. Also, it's possible to set UpdateSourceTrigger on TwoWay bindings to Explicit, in which case you control the updates to the source explicitly by calling UpdateSource.

For OneTime and OneWay bindings, calls to DependencyObject.SetValue automatically change the target value and delete the binding.

You can't set the property values of a Binding object after that binding has been attached to a target element and target property. If you attempt this you'll get a run-time exception.


This example demonstrates how to set the binding mode in XAML.

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

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0


Windows::UI::Xaml::Data [C++]



Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]


Windows::UI::Xaml::Data [C++]



See also

XAML data binding sample
Data binding in depth



© 2016 Microsoft