This documentation is archived and is not being maintained.

IXamlNameResolver Interface

Describes a service that can return objects that are specified by XAML name, or alternatively, returns a token that defers name resolution. The service can also return an enumerable set of all named objects that are in the XAML namescope.

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

public interface IXamlNameResolver

The IXamlNameResolver type exposes the following members.

Public propertyIsFixupTokenAvailableGets a value that determines whether calling GetFixupToken is available in order to resolve a name into a token for forward resolution.

Public methodGetAllNamesAndValuesInScopeReturns an enumerable set of all named objects in the XAML namescope.
Public methodGetFixupToken(IEnumerable<String>)Returns an object that can correct for certain markup patterns that produce forward references.
Public methodGetFixupToken(IEnumerable<String>, Boolean)Returns an object that can correct for certain markup patterns that produce forward references.
Public methodResolve(String)Resolves an object from a name reference.
Public methodResolve(String, Boolean)Resolves an object from a name reference, and provides a tracking value that reports whether the object is fully initialized for object graph purposes.

Public eventOnNameScopeInitializationCompleteOccurs when a XAML processor has registered all the relevant names to the backing XAML namescope.

This interface is not intended for external implementation of typical XAML scenarios because it is a service. This service enables markup extensions and type converters to resolve XAML names to other objects from the same XAML source while they are still in a XAML node representation. The service can be used to resolve forward references for any mechanism that relies on XAML names for nonlinear access to the surrounding XAML production. For more information, see Type Converters and Markup Extensions for XAML.

Type converters and markup extensions can query for IXamlNameResolver as a service on the service context that is provided by a XAML object writer, when the XAML object writer invokes value conversion behavior. For more information, see Type Converters and Markup Extensions for XAML and Service Contexts Available to Type Converters and Markup Extensions.

This service exposes an API that can defer name resolution. The metaphor implemented by the service is that names that cannot be resolved in a first pass against a partial name-object graph should be stored and used to create the fixup token. In the default behavior, all such names are submitted for another resolution attempt on a second pass. On the second pass, the overall name-object graph is complete, and all the fixup tokens are able to resolve.


Even if they are permitted by a particular implementation, forward references in XAML inevitably have performance consequences. As a best practice for production-quality XAML, avoid forward references whenever possible.

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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