IRootObjectProvider.RootObject Property

Gets the root object from markup or from an object graph.

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

Object RootObject { get; }

Property Value

Type: System.Object
The root object.

The root object in a XAML markup scenario might be useful for markup extension scenarios because of attributes that might by convention be set at the root level of XAML markup. Specific root object capabilities might be specified by frameworks. For example, certain attributes might only be valid at the root level, or a framework might support inheritance of global properties from the root.

In Silverlight, the type of the root object might also be relevant because of the role that type plays in the Silverlight application model. For example, a custom markup extension might restrict its usage to UserControl or Page, and enforce that it cannot be invoked from a ResourceDictionary root such as is used for a generic.xaml file.

Silverlight

Supported in: 5

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: