Why can I not add a set accessor to an overriden property?
- by Svish
In a base class I have this property:
public virtual string Text
{
get { return text; }
}
I want to override that and return a different text, but I would also like to be able to set the text, so I did this:
public override string Text
{
get { return differentText; }
set { differentText = value; }
}
This however does not work. I get a red squiggly under set saying that I can not override because it does not have a set accessor. Why is this aproblem? What should I do?