Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

INameScope Interface

Defines a contract for how names of elements should be accessed within a particular XAML namescope, and how to enforce uniqueness of names within that XAML namescope.

Namespace:  System.Windows.Markup
Assembly:  System.Xaml (in System.Xaml.dll)

public interface INameScope

The INameScope type exposes the following members.

  NameDescription
Public methodFindNameReturns an object that has the provided identifying name.
Public methodRegisterNameRegisters the provided name into the current XAML namescope.
Public methodUnregisterNameUnregisters the provided name from the current XAML namescope.
Top

This interface is implemented by classes that have child elements that are intended to be reused through the template or defer metaphor. Templates, factories and similar constructs must have unique XAML namescopes that are separate from a main object graph and root XAML. The principle here is that there should be no name collisions when objects created from those child elements are introduced to an application's object graph, and so that DOM operations and XAML reference techniques that rely on the name identifier can rely on name uniqueness in each XAML namescope.

In previous versions of the .NET Framework, this interface existed in the WPF-specific assembly WindowsBase. In .NET Framework 4, INameScope is in the System.Xaml assembly. For more information, see Types Migrated from WPF to System.Xaml.

WPF Usage Notes

This interface is implemented by the WPF class NameScope. Most XAML namescope operations in WPF operate by using NameScope instances, but information is occasionally communicated internally by using INameScope references.

Examples of WPF classes that use a factory or defer metaphor combined with XAML representation are Style and FrameworkTemplate. These implementations usually rely on the explicit versions of the interface methods available from the NameScope class.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft