I've tried this myself:
I added a string-valued property named "Direction" (and a PropertyDescriptor) to my Employee class.
Using the ControlBindingManager I bound the Direction property to a (DotNet) ComboBox, leaving the ListConverter configuration at default values.
I added a constant named "Direction" to ListConverterNames (in the Interface project)
In the ListConverterService (in the Foundation module) I added a new case for "Direction" that calls MakeDirectionConverter() to CreateServiceItemCore().
I added the method:
/// <summary>Get the global ListConverter for all TitlesOfCourtesy.</summary>
private static ListConverter MakeDirectionConverter()
{
ListConverter converter =
new ListConverter(typeof(string), Editability.Optional);
converter.ListSource =
new BindingSource(mDirections, null);
converter.DisplayMember =
"__Self";
return converter;
}
private static string[] mDirections = new string[] { "North", "South", "East", "West" };
to the ListConverterService.
Finally (!) I added this code to the presenter for my view:
/// <summary>Bind to the Direction List Control</summary>
/// <remarks>
/// Adds the proper ListConverter for Direction.
/// </remarks>
private void BindDirection() {
SetBindingListConverter(
Employee.Descriptors.Direction, ListConverterNames.Direction);
}
This works--the list appears properly and the selected value is bound to the Direction property of the Employee entity.
Whew! Thats quite a bit of stuff, though most of the complexity has to do with getting the ListConverter from a service, CAB style. I'll ask Ward if he can recommend a simpler mechanism.
Bill