DependencyPropertyConverter.CanConvertFrom 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
判斷指定類型的物件是否能轉換為 的 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實例。 因此只有 a sourceType 回 String 返回 true。
context 此實作未使用。