Windows apps
Collapse the table of content
Expand the table of content
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.

IXamlNameResolver Interface

.NET Framework (current version)

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


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


Returns an enumerable set of all named objects in the XAML namescope.


Returns an object that can correct for certain markup patterns that produce forward references.

System_CAPS_pubmethodGetFixupToken(IEnumerable<String>, Boolean)

Returns an object that can correct for certain markup patterns that produce forward references.


Resolves an object from a name reference.

System_CAPS_pubmethodResolve(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.


Occurs 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
Available since 4.0
Return to top
© 2017 Microsoft