FrameworkElement.DataContext property

Expand
0 out of 2 rated this helpful - Rate this topic

FrameworkElement.DataContext property

[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


public object DataContext { get; set; }


<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

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

Metadata

Windows.winmd

See also

FrameworkElement

 

 

Build date: 5/22/2012

Did you find this helpful?
(1500 characters remaining)
Community Additions ADD