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

備註

UIElement第一次建立 時, XamlRootnull 回 。 在父代為即時 XAML 物件之後,它會傳回與其父系相同的 XamlRoot 物件。 的常見案例 XamlRootnull 是,如果您從應用程式的建構函式存取 屬性。

適用於