IRootObjectProvider.RootObject Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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

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

Syntax

'Declaration
ReadOnly Property RootObject As Object
Object RootObject { get; }

Property Value

Type: System.Object
The root object.

Remarks

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.

Version Information

Silverlight

Supported in: 5

Platforms

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