UIElement.XamlRoot 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置 XamlRoot 在其中查看此元素的 。
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
属性值
在其中 XamlRoot 查看此元素的 。 默认为 null。
Windows 要求
| 设备系列 |
Windows 10, version 1903 (在 10.0.18362.0 中引入)
|
| API contract |
Windows.Foundation.UniversalApiContract (在 v8.0 中引入)
|
注解
UIElement首次创建 时,XamlRoot返回 null。 在将其父级化为活动 XAML 对象后,它将返回与其父对象相同的 XamlRoot 对象。 如果从应用的构造函数访问 属性,则为 的一种常见方案XamlRootnull。