Binding Constructor (String)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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)

Syntax

Public Sub New ( _
    path As String _
)
public Binding(
    string path
)

Parameters

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

Exceptions

Exception Condition
ArgumentNullException

path is nullNothingnullptra null reference (Nothing in Visual Basic).

Remarks

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 ("").

Examples

'Create the source string 
Dim s As String = "Hello"

'Create the binding description 
Dim b As New Binding("")
b.Mode = BindingMode.OneTime
b.Source = s

'Attach the binding to the target 
MyText.SetBinding(TextBlock.TextProperty, b)
//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);

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Platforms

Windows Phone

See Also

Reference

Binding Class

Binding Overload

System.Windows.Data Namespace

Other Resources

Data binding for Windows Phone 8