[This documentation is preliminary and is subject to change.]
Attaches a binding to a FrameworkElement, using the provided binding object.
Syntax
Parameters
- dp
-
Type: DependencyProperty
The dependency property identifier of the property that is data bound.
- binding
-
Type: BindingBase
The binding to use for the property.
Examples
This example establishes a binding to a dependency property on an object by calling SetBinding.
// 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);
Requirements
|
Minimum supported client | Windows 8 Release Preview |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 5/22/2012
