Unused properties when only used for data binding
It seems that if I create an private class in which I declare a property,
and I only use this class for binding lists to a combo box, resharper flags
that I have not used the property get anywhere and it can be removed. When
actually it is used as the DataMember of the combo box:
IList list = GetpopulatedList();
ComboBox.DataSource = list;
ComboBox.DisplayMember = "Name";
private class PrivateClass
{
public NamedWaypointSourceForm (string name, Form form)
{
Name = name;
Form = form;
}
public string Name { get; private set; }
public Form Form { get; private set; }
}
Is there anyway that this can be avoided, or is the fact that it is only
used via reflection just one of those things?
Please sign in to leave a comment.
You can include the JetBrains.Annotations library and mark the property with
the UsedImplictly attribute which should clear the suggestion.
HTH
David
"Sam Holder" <sam.holder@bentley.com> wrote in message
news:befa57e832ef8ccadcf4acf8d1b@news.jetbrains.com...
>
>
>
>
>
>
>
>