XamlRoot Class

Definition

Represents a tree of XAML content and information about the context in which it is hosted.

Equivalent WinUI class: Microsoft.UI.Xaml.XamlRoot.

public ref class XamlRoot sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 524288)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.WebHostHidden]
class XamlRoot final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 524288)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.WebHostHidden]
public sealed class XamlRoot
Public NotInheritable Class XamlRoot
Inheritance
XamlRoot
Attributes

Windows 10 requirements

Device family
Windows 10, version 1903 (introduced in 10.0.18362.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v8.0)

Properties

Content

Gets the root element of the XAML element tree.

Equivalent WinUI property: Microsoft.UI.Xaml.XamlRoot.Content.

IsHostVisible

Gets a value that indicates whether the XamlRoot is visible.

Equivalent WinUI property: Microsoft.UI.Xaml.XamlRoot.IsHostVisible.

RasterizationScale

Gets a value that represents the number of raw (physical) pixels for each view pixel.

Equivalent WinUI property: Microsoft.UI.Xaml.XamlRoot.RasterizationScale.

Size

Gets the width and height of the content area.

Equivalent WinUI property: Microsoft.UI.Xaml.XamlRoot.Size.

UIContext

Gets the context identifier for the view.

Events

Changed

Occurs when a property of XamlRoot has changed.

Equivalent WinUI event: Microsoft.UI.Xaml.XamlRoot.Changed.

Applies to