Export (0) Print
Expand All

XamlValueConverter<TConverterBase> Class

Provides a common API surface for techniques that generate initialization or serialization values for XAML based on input other than the eventual destination type. This includes markup extensions and type converters.

System.Object
  System.Xaml.Schema.XamlValueConverter<TConverterBase>

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

public class XamlValueConverter<TConverterBase> : IEquatable<XamlValueConverter<TConverterBase>>
where TConverterBase : class

Type Parameters

TConverterBase

The CLR base class for the particular converter that this XamlValueConverter<TConverterBase> represents. Typically this is one of the following: TypeConverter; MarkupExtension; ValueSerializer;

The XamlValueConverter<TConverterBase> type exposes the following members.

  NameDescription
Public methodXamlValueConverter<TConverterBase>(Type, XamlType)Initializes a new instance of the XamlValueConverter<TConverterBase> class, based on a converter implementing Type and the target/destination type of the XamlValueConverter<TConverterBase>.
Public methodXamlValueConverter<TConverterBase>(Type, XamlType, String)Initializes a new instance of the XamlValueConverter<TConverterBase> class, based on a converter implementing Type the target/destination type of the XamlValueConverter<TConverterBase>, and a string name.
Top

  NameDescription
Public propertyConverterInstanceGets a created instance of the converter implementation.
Public propertyConverterTypeGets the Type for the class that implements the converter behavior.
Public propertyNameGets a string name for this XamlValueConverter<TConverterBase>.
Public propertyTargetTypeGets the target/destination XamlType of the XamlValueConverter<TConverterBase>.
Top

  NameDescription
Protected methodCreateInstanceReturns an instance of the converter implementation.
Public methodEquals(Object)Determines whether this instance of XamlValueConverter<TConverterBase> and a specified object, which must also be a XamlValueConverter<TConverterBase> object, have the same value. (Overrides Object.Equals(Object).)
Public methodEquals(XamlValueConverter<TConverterBase>)Determines whether this instance of XamlValueConverter<TConverterBase> and another XamlValueConverter<TConverterBase> object have the same value.
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeReturns the hash code for this XamlValueConverter<TConverterBase>. (Overrides Object.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a String that represents this XamlValueConverter<TConverterBase>. (Overrides Object.ToString().)
Top

  NameDescription
Public operatorStatic memberEqualityDetermines whether two specified XamlValueConverter<TConverterBase> objects have the same value.
Public operatorStatic memberInequalityDetermines whether two specified XamlValueConverter<TConverterBase> objects have different values.
Top

Instances of this type are returned by methods of the XAML schema API such as LookupTypeConverter. The generic implementation of XamlValueConverter<TConverterBase> provides indirection for the System.Xaml assembly so that the basic XAML schema and type system does not have to take dependencies on different value conversion techniques that are typically implementations in other assemblies.

A XamlValueConverter<TConverterBase> can be constructed with a null implementation type, but such a XamlValueConverter<TConverterBase> will return null for CreateInstance.

Constructor signatures for XamlValueConverter<TConverterBase> use a converterType parameter that references the specific type that implements the conversion behavior. For a properly functioning XamlValueConverter<TConverterBase> (one that has a nonnull ConverterInstance), the converterType type is expected to be castable to the TConverterBase constraint. A mismatch condition is not enforced by constructors, but might produce an InvalidCastException at run time.

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft