I have a custom attribute and I need to have the name of the property that it is on. Write now the name is just a string parameter in the attribute constructor. It works, but just doesn't feel write.
Current Implementation
[ListViewColumnDescription("Key", 1, "My Key", true)]
public Guid Key
{
get;
set;
}
Would like something more like this
[ListViewColumnDescription(1, "My Key", true)]
public Guid Key
{
get;
set;
}
Edit: I'm actually storing the attributes and using them to look up the properties. It makes it easier to add the properties to the ListViewItem in the correct order. That is what the first parameter is. It is the column number.
Edit 2: I am just setting the property name in the attribute was I find them while looking through the properties.