UIElement.XamlRoot Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the XamlRoot
in which this element is being viewed.
public:
property XamlRoot ^ XamlRoot { XamlRoot ^ get(); void set(XamlRoot ^ value); };
XamlRoot XamlRoot();
void XamlRoot(XamlRoot value);
public XamlRoot XamlRoot { get; set; }
var xamlRoot = uIElement.xamlRoot;
uIElement.xamlRoot = xamlRoot;
Public Property XamlRoot As XamlRoot
The XamlRoot
in which this element is being viewed. The default is null
.
Device family |
Windows 10, version 1903 (introduced in 10.0.18362.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v8.0)
|
When a UIElement
is first created, XamlRoot
returns null
. After it's parented to a live XAML object, it will return the same XamlRoot
object as its parent. A common scenario for XamlRoot
to be null
is if you access the property from the constructor of your app.
Product | Versions |
---|---|
WinRT | Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |