[This documentation is preliminary and is subject to change.]
Gets or sets the data context for a FrameworkElement when it participates in data binding.
Syntax
<frameworkElement DataContext="binding"/> - or - <frameworkElement DataContext="{StaticResource keyedObject}"/>
XAML Values
- binding
-
A binding expression that can reference an existing data context, or a property in the data context. See QuickStart: Data binding to controls or Binding markup extension.
- keyedObject
-
The x:Key value of an object that exists in an in-scope Resources collection. Typically, this is an object element instantiation of a custom type defined elsewhere in your code, and requires a custom XAML namespace mapping in the ResourceDictionary.
Property value
Type: System.Object [.NET] | Platform::Object [C++]
The object to use as data context.
Requirements
|
Minimum supported client | Windows 8 Release Preview |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 5/22/2012
