I have these classes
1. MainGUI class -> GameManager class -> Game class -> Player class -> Hand
class
The arrow is the call sequence
In the Hand class I have this code that raise an event when I add a card to
a players hand
public void AddCard(Card card)
{
cards.Add(card);
NotifyPropertyChanged("CardAdded");
}
private void NotifyPropertyChanged(string info)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(info));
}
}
Now to my question if I now want MainGUI to be notified when this AddCard
method is called in the Hand class
is that possible ?
The only way I can see is to pass the object reference to this hand class
all the way to the MainGUI class which will be cumbersome.
The actual event object that is stored in the Hand class is defined in this
way
public event PropertyChangedEventHandler PropertyChanged;
//Tony
|