Property names can be changed with
[Category("Application"), DisplayName("Application"), Description("Application settings")]
But can I get rid of the class name in a category? I wish to display my own "string" there. I have tried DisplayName
etc (see example class below), but no change.
Any idea? Besides Application
I wish to see some description.
Example classes:
public class CSettings
{
[Category("Application"), DisplayName("Application"), Description("Application settings")]
public CApplicationSettings Application { get; set; } = new CApplicationSettings();
[Category("Audio"), Display(Name = "Audio", Description = "Audio settings")]
public CAudioSettings Audio { get; set; } = new CAudioSettings();
}
As you can see, also tried to apply it on "class level"
[TypeConverter(typeof(ExpandableObjectConverter))]
[Description("Application general settings")]
[DisplayName("General settings")]
public class CApplicationSettings
{
[Description("Application Hotkeys")]
[DisplayName("Hotkeys")]
public CHotkeyList Hotkeys { get; set; } = CHotkeyList.DefaultHotykeys;
}
Related
Credits/thanks to Simon Mourier and dr.null / Summary of their comments
CApplicationSettings
's ToString
method orTypeConverter
(you can derive it from ExpandableObjectConverter
), override ConvertTo
, and return a string when destinationType == typeof(string)
. An example is the answer of Property Grid on composite objects here: https://stackoverflow.com/a/241942/356726