IXamlNameResolver Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
public interface class IXamlNameResolver
public interface IXamlNameResolver
type IXamlNameResolver = interface
Public Interface IXamlNameResolver
Remarks
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.
Note
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.
Properties
IsFixupTokenAvailable |
Gets a value that determines whether calling GetFixupToken(IEnumerable<String>, Boolean) is available in order to resolve a name into a token for forward resolution. |
Methods
GetAllNamesAndValuesInScope() |
Returns an enumerable set of all named objects in the XAML namescope. |
GetFixupToken(IEnumerable<String>, Boolean) |
Returns an object that can correct for certain markup patterns that produce forward references. |
GetFixupToken(IEnumerable<String>) |
Returns an object that can correct for certain markup patterns that produce forward references. |
Resolve(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. |
Resolve(String) |
Resolves an object from a name reference. |
Events
OnNameScopeInitializationComplete |
Occurs when a XAML processor has registered all the relevant names to the backing XAML namescope. |