XamlType.LookupIsAmbient 方法

定義

傳回值,這個值表示此 XamlType 是否代表符合 XAML 定義的環境型別。

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

傳回

如果這個 XamlType 表示環境型別,則為 true,否則為 false

備註

您可以呼叫 來 IsAmbient 叫用這個方法。

預設實作會在 上使用 CLR 反映, UnderlyingType 並可檢查基底類型。 這個實作會檢查 AmbientAttribute 套用至類別層級相關型別定義的 ,並在此案例中傳 true 回 。 所有其他案例都會傳回 false

如果您想要 IsAmbient 傳回與預設內部反映啟用不同的值,請覆寫這個方法。

適用於