XamlValueConverter<TConverterBase> XamlValueConverter<TConverterBase> XamlValueConverter<TConverterBase> XamlValueConverter<TConverterBase> Class

定義

針對根據最終目的型別以外之輸入產生 XAML 初始化及序列化值的技術,提供一般 API 介面。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.

generic <typename TConverterBase>
 where TConverterBase : classpublic ref class XamlValueConverter : IEquatable<System::Xaml::Schema::XamlValueConverter<TConverterBase> ^>
public class XamlValueConverter<TConverterBase> : IEquatable<System.Xaml.Schema.XamlValueConverter<TConverterBase>> where TConverterBase : class
type XamlValueConverter<'ConverterBase (requires 'ConverterBase : null)> = class
    interface IEquatable<XamlValueConverter<'ConverterBase>>
Public Class XamlValueConverter(Of TConverterBase)
Implements IEquatable(Of XamlValueConverter(Of TConverterBase))

類型參數

TConverterBase

這個 XamlValueConverter<TConverterBase> 所表示之特定轉換子的 CLR 基底類別。The CLR base class for the particular converter that this XamlValueConverter<TConverterBase> represents. 這通常是下列其中一項:TypeConverterMarkupExtensionValueSerializerTypically this is one of the following: TypeConverter; MarkupExtension; ValueSerializer;

繼承
XamlValueConverter<TConverterBase>XamlValueConverter<TConverterBase>XamlValueConverter<TConverterBase>XamlValueConverter<TConverterBase>
實作
IEquatable<XamlValueConverter<TConverterBase>>

備註

此類型的執行個體所傳回的 XAML 結構描述 API 方法這類LookupTypeConverterInstances of this type are returned by methods of the XAML schema API such as LookupTypeConverter. 泛型實作XamlValueConverter<TConverterBase>提供間接取值 System.Xaml 組件,以便不需要採取相依性不同的值轉換技術,它們通常是在其他實作基本的 XAML 結構描述和類型系統組件。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.

AXamlValueConverter<TConverterBase>可為 null 的實作型別,但這類建構XamlValueConverter<TConverterBase>會傳回nullCreateInstanceA XamlValueConverter<TConverterBase> can be constructed with a null implementation type, but such a XamlValueConverter<TConverterBase> will return null for CreateInstance.

建構函式簽章XamlValueConverter<TConverterBase>使用converterType參考實作的轉換行為的特定型別參數。Constructor signatures for XamlValueConverter<TConverterBase> use a converterType parameter that references the specific type that implements the conversion behavior. 正確運作XamlValueConverter<TConverterBase>(具有非 null ConverterInstance),則converterType預期類型可以轉型TConverterBase條件約束。For a properly functioning XamlValueConverter<TConverterBase> (one that has a nonnull ConverterInstance), the converterType type is expected to be castable to the TConverterBase constraint. 不符合條件的建構函式不會強制執行,但可能會產生InvalidCastException在執行階段。A mismatch condition is not enforced by constructors, but might produce an InvalidCastException at run time.

建構函式

XamlValueConverter<TConverterBase>(Type, XamlType) XamlValueConverter<TConverterBase>(Type, XamlType) XamlValueConverter<TConverterBase>(Type, XamlType) XamlValueConverter<TConverterBase>(Type, XamlType)

根據實作 XamlValueConverter<TConverterBase> 的轉換子和 Type 的目標/目的型別,初始化 XamlValueConverter<TConverterBase> 類別的新執行個體。Initializes a new instance of the XamlValueConverter<TConverterBase> class, based on a converter implementing Type and the target/destination type of the XamlValueConverter<TConverterBase>.

XamlValueConverter<TConverterBase>(Type, XamlType, String) XamlValueConverter<TConverterBase>(Type, XamlType, String) XamlValueConverter<TConverterBase>(Type, XamlType, String) XamlValueConverter<TConverterBase>(Type, XamlType, String)

根據實作 XamlValueConverter<TConverterBase> 的轉換子、Type 的目標/目的型別以及字串名稱,初始化 XamlValueConverter<TConverterBase> 類別的新執行個體。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.

屬性

ConverterInstance ConverterInstance ConverterInstance ConverterInstance

取得建立的轉換子實作執行個體。Gets a created instance of the converter implementation.

ConverterType ConverterType ConverterType ConverterType

取得實作轉換子行為的類別的 TypeGets the Type for the class that implements the converter behavior.

Name Name Name Name

取得這個 XamlValueConverter<TConverterBase> 的字串名稱。Gets a string name for this XamlValueConverter<TConverterBase>.

TargetType TargetType TargetType TargetType

取得 XamlType 的目標/目的 XamlValueConverter<TConverterBase>Gets the target/destination XamlType of the XamlValueConverter<TConverterBase>.

方法

CreateInstance() CreateInstance() CreateInstance() CreateInstance()

傳回轉換子實作執行個體。Returns an instance of the converter implementation.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷這個 XamlValueConverter<TConverterBase> 執行個體和指定之物件 (必須是 XamlValueConverter<TConverterBase> 物件) 是否具有相同的值。Determines whether this instance of XamlValueConverter<TConverterBase> and a specified object, which must also be a XamlValueConverter<TConverterBase> object, have the same value.

Equals(XamlValueConverter<TConverterBase>) Equals(XamlValueConverter<TConverterBase>) Equals(XamlValueConverter<TConverterBase>) Equals(XamlValueConverter<TConverterBase>)

判斷這個 XamlValueConverter<TConverterBase> 執行個體和另一個 XamlValueConverter<TConverterBase> 物件是否具有相同的值。Determines whether this instance of XamlValueConverter<TConverterBase> and another XamlValueConverter<TConverterBase> object have the same value.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

傳回這個 XamlValueConverter<TConverterBase> 的雜湊程式碼。Returns the hash code for this XamlValueConverter<TConverterBase>.

GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

傳回表示這個 StringXamlValueConverter<TConverterBase>Returns a String that represents this XamlValueConverter<TConverterBase>.

運算子

Equality(XamlValueConverter<TConverterBase>, XamlValueConverter<TConverterBase>) Equality(XamlValueConverter<TConverterBase>, XamlValueConverter<TConverterBase>) Equality(XamlValueConverter<TConverterBase>, XamlValueConverter<TConverterBase>) Equality(XamlValueConverter<TConverterBase>, XamlValueConverter<TConverterBase>)

判斷兩個指定的 XamlValueConverter<TConverterBase> 物件是否具有相同的值。Determines whether two specified XamlValueConverter<TConverterBase> objects have the same value.

Inequality(XamlValueConverter<TConverterBase>, XamlValueConverter<TConverterBase>) Inequality(XamlValueConverter<TConverterBase>, XamlValueConverter<TConverterBase>) Inequality(XamlValueConverter<TConverterBase>, XamlValueConverter<TConverterBase>) Inequality(XamlValueConverter<TConverterBase>, XamlValueConverter<TConverterBase>)

判斷兩個指定的 XamlValueConverter<TConverterBase> 物件是否具有不同的值。Determines whether two specified XamlValueConverter<TConverterBase> objects have different values.

適用於