XamlMember.LookupIsAmbient 方法

定義

傳回這個 XamlMember 是否報告為環境屬性。

protected:
 virtual bool LookupIsAmbient();
protected virtual bool LookupIsAmbient ();
abstract member LookupIsAmbient : unit -> bool
override this.LookupIsAmbient : unit -> bool
Protected Overridable Function LookupIsAmbient () As Boolean

傳回

Boolean

true 報告這個 XamlMember 為環境屬性,否則為 false

備註

這個方法是由檢查環境 XAML 屬性資訊的內部呼叫所叫用。 環境屬性行為會考慮 XAML 讀取器和 XAML 寫入器的公用 API 行為。 參考 LookupIsAmbient 的內部呼叫通常是 XAML 處理邏輯的一部分,以確保依賴環境使用類型限定性的物件和值可以正常運作。 預設.NET Framework XAML 服務實作會使用 CLR 屬性,從反映到備份類型取得這項資訊。 具體而言,預設實作會檢查 AmbientAttribute 成員定義上是否存在 AmbientAttribute ,並傳 LookupIsAmbienttrue

如果您未 AmbientAttribute 使用此用途,而且想要以您自己的技術取代表示環境 XAML 屬性的技術,請覆寫這個方法。

具有 的 AmbientAttribute WPF 範例 API 為 Trigger.PropertyStyle.BasedOn

適用於

另請參閱