Share via


DependencyPropertyConverter.CanConvertFrom 方法

定義

判斷指定之型別的物件是否可轉換成 DependencyProperty 的執行個體。

public:
 override bool CanConvertFrom(System::ComponentModel::ITypeDescriptorContext ^ context, Type ^ sourceType);
public override bool CanConvertFrom (System.ComponentModel.ITypeDescriptorContext context, Type sourceType);
override this.CanConvertFrom : System.ComponentModel.ITypeDescriptorContext * Type -> bool
Public Overrides Function CanConvertFrom (context As ITypeDescriptorContext, sourceType As Type) As Boolean

參數

context
ITypeDescriptorContext

格式內容,提供正在叫用此轉換器之環境的相關資訊。

sourceType
Type

正在評估以進行轉換的型別。

傳回

如果這個轉換子可以執行作業,則為 true,否則為 false

備註

類別 DependencyPropertyConverter 只會將字串轉換成 的 DependencyProperty實例。 因此,只有的 StringsourceTypetrue回 。

context 這個實作不會使用此實作。

適用於