語言

XamlObjectWriterSettings.ExternalNameScope 屬性

定義

取得 RegisterNamesOnExternalNamescope 或設定 XAML 命名範圍,以便在 為 true時,從 XAML 編譯器註冊名稱。

public:
 property System::Windows::Markup::INameScope ^ ExternalNameScope { System::Windows::Markup::INameScope ^ get(); void set(System::Windows::Markup::INameScope ^ value); };
public System.Windows.Markup.INameScope ExternalNameScope { get; set; }
member this.ExternalNameScope : System.Windows.Markup.INameScope with get, set
Public Property ExternalNameScope As INameScope

屬性值

XAML 名稱範圍用於註冊名稱。 預設值為 null。

備註

特定情境 XamlObjectWriter 可能會使用外部 XAML 名稱範圍。

WPF 使用方式注意事項

在WPF XAML 實作中,由 FrameworkTemplate 發起的 XAML 寫入操作會指定一個獨立的 XAML 名稱範圍。 在此 WPF 情境中,模板不應與定義它們的 XAML 頁面根目錄共享 XAML 名稱範圍。 相反地,它們應該處理成一個獨立且指定的 XAML 名稱範圍。

適用於