This works for the initial creation of the list.
I need to force the ExpandableCollectionConverter.ListItemPropertyDescriptor.DisplayName to be reevaluated when a property object changes. I did that by placing a propertychanged handler on all the items as they are added to the ListItemPropertyDescriptor. When I get the change event how do I make the ExpandableCollectionConverter redraw that one item?
private class MyListPropertyDescriptor : ExpandableCollectionConverter.ListItemPropertyDescriptor
{
public MyListPropertyDescriptor(System.Collections.IList list, int index, Type itemType, Attribute[] attributes, bool isCollectionReadOnly, bool isReadOnly)
: base(list, index, itemType, attributes, isCollectionReadOnly, isReadOnly)
{
// lay in a property change notification that will
var cmd = list[index] as MultiCueAddLogicalFireOrDwellCommand;
if(cmd != null)
{
cmd.PropertyChanged += Cmd_PropertyChanged;
}
}
private void Cmd_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
// WHAT DO WE DO HERE???
}
public override string DisplayName
{
get
{
switch (this.List[Index])
{
case MultiCueAddLogicalFireOrDwellCommand mcalcmd:
switch (mcalcmd.FiringType)
{
case MultiCueFiringType.None:
case MultiCueFiringType.Fire:
return $"T+{mcalcmd.TimingOffset:00.000} Id: {mcalcmd.LogicalId} Cue: {mcalcmd.Cue}";
case MultiCueFiringType.Dwell:
return $"T+{mcalcmd.TimingOffset:00.000} Id: {mcalcmd.LogicalId} Cue: {mcalcmd.Cue} Dwell {mcalcmd.Dwell:0.0}";
case MultiCueFiringType.DMX:
return $"T+{mcalcmd.TimingOffset:00.000} Id: {mcalcmd.LogicalId} Cue: {mcalcmd.Cue} DMX {mcalcmd.Dwell:0.0}";
}
break;
}
return this.List[Index].GetType().ToString();
}
}
}