Search code examples
tfs-sdktfs-workitem

How to 'host' a Work Item inside a WinForms application?


I've come across a couple applications in the past that run outside VS2010 (or MTM) but display TFS Work Items 100% as they are shown in VS2010 as if there was a way to get the WorkItem including all its controls as a complete 'control' and place it inside my own application.

Does anyone know how to do that? I am currently trying to remember where I saw that, but maybe someone knows what I am talking about and can point me in the right direction TFS client api wise!?


Solution

  • Use the Microsoft.TeamFoundation.WorkItemTracking.Controls.WorkItemFormControl class. Doc on the MSDN.

    This class has a property Item of type WorkItem, set the object and you're good to go. If you want an application that uses it, I made this one, go get the sources, it's in the CegWICreator Project in the MainForm.cs file. If I remember correctly (the app is quite old) this control is pretty well used at some different places.