Export (0) Print
Expand All

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.

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

  NameDescription
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.
Top

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

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.

NoteNote

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.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4

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