UIElement.XamlRoot 屬性

定義

取得或設定 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 次建立 時, XamlRootnull 回 。 父代至即時 XAML 物件之後,它會傳回與其父代相同的 XamlRoot 物件。 常見的案例 XamlRootnull 是,如果您從應用程式的建構函式存取 屬性。

適用於