Is there a way to do this with Auto Properties?
I have code that looks something like this:
Card m_currentCard;
public Card CurrentCard {
get { return m_currentCard; }
set {
m_currentCard = value;
QuestionLabel.Text = CurrentCard.Question;
}
}
It doesn't do anything special in terms of getting and setting the value of the property, but it does something additional when setting the property. Am I stuck using a separate variable,开发者_如何学JAVA or is there a way to do this with auto properties?
It is not possible to do that using automatically implemented properties.
精彩评论