In the base class, I have this property:
public virtual string Text
{
get { return text; }
}
I want to override this and return another 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 cannot override because it does not have an access set. Why is this a problem? What should I do?
source
share