Project Description
This custom work item control can be used to display the Active Directory picture of a user selected in a work item field that takes a valid user as its input.


Using the Photo Custom Control in a Work Item

The source code includes a modified version of the Task work item that ships with the MSF for Agile Software Development v5.0 process template. The screenshot below shows what the work item looks like with the PhotoControl when selected a user with an Active Directory photo in the Assigned To field:

PhotoControlSample.png

To upload an Active Directory photo for your user account, you can use the following tool: OutlookPhoto

The following screeshot shows a snippet from the modified Task work item demonstrates the use of the PhotoControl:

PhotoControlSample2.png

How Does it Work?

The operation is pretty simple. You bind a field that allows valid users to the PhotoControl. Where the bound field has a value, the PhotoControl is notified and it searches Active Directory for the user account corresponding to the selected display name. If the user account has a thumbnailPhoto, then that thumbnail photo is displayed in the work item. If the account has not thumbnail photo associated with it, the photo control remains blank.

Other Ways to Use the PhotoControl

You can also use the new PreferredType attribute on the Control to provide a fallback field for the PhotoControl. In the example below, the fallback would be to display the Assigned To field's Display Name.

PhotoControlSample3.png

This is what it will look like if you were to use the Process Editor:

PhotoControlSample4.png

Resources


Hope you enjoy!

Last edited Apr 4, 2011 at 5:14 AM by mojallou, version 2