Export (0) Print
Expand All

IDestinationTypeProvider Interface

Represents a service that can return a CLR type system identifier for the destination type. The destination type is relevant when the destination type for a property-setting operation is indirectly reported by reflection or other mechanisms.

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

public interface IDestinationTypeProvider

The IDestinationTypeProvider type exposes the following members.

  NameDescription
Public methodGetDestinationTypeReturns the CLR Type that identifies the destination type for the relevant type converter or markup extension.
Top

The type that is returned by GetDestinationType is resolved from the current position of the XAML node stream by using current XAML schema context.

If you use the XAML type system as implemented by .NET Framework XAML Services and access the service context under these conditions, GetDestinationType returns the UnderlyingType based on available XAML type system information and CLR-based XAML schema context.

This service is relevant for situations where pure CLR reflection or other mechanisms might not provide enough information about a destination type. The following is a list of some relevant scenarios for IDestinationTypeProvider:

  • The CLR type system reports an indirect type because of how the CLR defines and uses types, and you want a true destination type. For example, the APIs in .NET Framework XAML Services use this service internally when they process event members. Events are reported by pure CLR reflection as a Delegate.

  • You want to ensure that the destination type of a type converter usage matches the expected type that the type converter can produce. This scenario is useful when the destination type is parameterized or generic.

  • Your value converter is being called from a usage that nested in another value converter. In this case, GetDestinationType unwinds the nesting and returns the destination type of the actual property being set, instead of returning the output type of any intervening value converter.

Type converters and markup extensions can query for IDestinationTypeProvider 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.

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

Community Additions

ADD
Show:
© 2014 Microsoft