Question about Assigning Categories

Jan 13, 2011 at 5:26 PM


This is really a question about using PropertyEditor. As well as using PropertyEditor to inspect and edit my classes I am also using it to edit  values in Properties.Settings.Default. Is there any way that I can use the Category attribute to assign Categories to my settings in Properties.Settings.Default on the fly thus saving me having to manually edit the automatically generated Settings.Designer.cs file? Is it even possible?

I am just starting using Wpf so any help would be much appreciated.


Thanks Alan

Jan 13, 2011 at 7:16 PM

Ifaik, you cannot add Attributes to classes at runtime.

Jan 14, 2011 at 8:03 AM

hi Alan, I would suggest that you create a ViewModel of the Settings.Default class for the PropertyEditor. Then you can add attributes, and also control which settings are editable and not.

If you don't want to create such a ViewModel, you could stop using the VS editor for the settings class, and write the class manually (not much more work).

Jan 14, 2011 at 5:18 PM


I had it in mind to create a viewmodel, I just wondered if there was an alternative.