NameScope Class

Implements base support for the INameScope methods that store or retrieve name-object mappings into a particular namescope, and adds attached property support to make it simpler to get or set identifier namescope information dynamically at the element level..

Namespace: System.Windows
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:

Public Class NameScope
	Implements INameScope
Dim instance As NameScope

public class NameScope implements INameScope
public class NameScope implements INameScope
<NameScope .../>

This class supports creation of logical tree name scopes that are created by processes that occur outside of normal Extensible Application Markup Language (XAML) loading of elements. For instance, NameScope assists in creation of initial namescopes based on the logical tree, such as when instantiating styles and templates.

For most scenarios, the FindName methods exposed on FrameworkElement and FrameworkContentElement are more appropriate methods to call to search for elements by name. The Name properties exposed by FrameworkElement and FrameworkContentElement are more appropriate properties to use to set the initial name as markup attributes. And the RegisterName methods exposed on FrameworkElement and FrameworkContentElement is necessary to establish a name into a specific namescope.

The various methods of NameScope are used by base elements and other classes that define namescopes in order to support RegisterName and FindName.

Other similar methods exist on specialized namescopes. For details, see WPF Namescopes.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions