[DisplayName] stopped working

Oct 3, 2013 at 11:31 AM
Edited Oct 3, 2013 at 12:19 PM
Anyone any ideas why using [DisplayName("Fred")] is not working on some of my forms?

it seems to have changed since I went to a custom PropertyControlFactory based on the example shipped with the Source

<propTool:PropertyControl Grid.Row="0" PropertyItemFactory="{Binding PropertyItemFactory}" PropertyControlFactory="{Binding PropertyControlFactory}" DockPanel.Dock="Top" Margin="8" SelectedObject="{Binding SelectedItemPSCData}" ShowDeclaredOnly="False" CategoryControlType="Expander"/>

instead of my original which was

<propTool:PropertyControl Margin="8" SelectedObject="{Binding SelectedGraphicObject}" ShowDeclaredOnly="False"/>



thanks
Oct 3, 2013 at 12:58 PM
OK, I have fixed it, I needed to replace the GetDisplayName Function in the ProperyItemFactory with the one from the source
    protected override string GetDisplayName(PropertyDescriptor pd, Type declaringType)
    {
        var displayName = pd.DisplayName;
        if (this.NicifyDisplayNames && pd.DisplayName == pd.Name)
        {
            displayName = NicifyString(displayName);
        }

        return displayName;


    }