Binding Constructor (String)

Initializes a new instance of the Binding class with an initial property path for the data source.

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

public Binding(
	string path


Type: System.String
The initial property path for the source of the binding.


path is null.

The path can be a direct property of the source object or subproperties.

To set the data source to be the Source object, the path should be an empty string ("").

//Create the source string
string s = "Hello";

//Create the binding description
Binding b = new Binding("");
b.Mode = BindingMode.OneTime;
b.Source = s;

//Attach the binding to the target
MyText.SetBinding(TextBlock.TextProperty, b);


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.