共用方式為


CollectionTransformation.Transform<TSourceCollection, TSourceElement, TTargetElement> 方法

命名空間:  Microsoft.TeamFoundation.MVVM
組件:  Microsoft.TeamFoundation.Controls (在 Microsoft.TeamFoundation.Controls.dll 中)

語法

'宣告
<ExtensionAttribute> _
Public Shared Function Transform(Of TSourceCollection As {Class, Object, IEnumerable(Of TSourceElement), INotifyCollectionChanged}, TSourceElement, TTargetElement) ( _
    sourceCollection As TSourceCollection, _
    setup As Func(Of TSourceElement, TTargetElement), _
    teardown As Action(Of TTargetElement) _
) As TransformedCollection(Of TSourceCollection, TSourceElement, TTargetElement)
public static TransformedCollection<TSourceCollection, TSourceElement, TTargetElement> Transform<TSourceCollection, TSourceElement, TTargetElement>(
    this TSourceCollection sourceCollection,
    Func<TSourceElement, TTargetElement> setup,
    Action<TTargetElement> teardown
)
where TSourceCollection : class, Object, IEnumerable<TSourceElement>, INotifyCollectionChanged

型別參數

  • TSourceCollection
  • TSourceElement
  • TTargetElement

參數

  • sourceCollection
    型別:TSourceCollection
  • setup
    型別:System.Func<TSourceElement, TTargetElement>

傳回值

型別:Microsoft.TeamFoundation.MVVM.TransformedCollection<TSourceCollection, TSourceElement, TTargetElement>

使用注意事項

在 Visual Basic 和 C# 中,您可以在任何 TSourceCollection 型別物件中呼叫這個方法以做為執行個體。使用執行個體方法語法呼叫這個方法時,請省略第一個參數。如需詳細資訊,請參閱擴充方法 (Visual Basic)擴充方法 (C# 程式設計手冊)

.NET Framework 安全性

請參閱

參考

CollectionTransformation 類別

Microsoft.TeamFoundation.MVVM 命名空間