In my TreeView I've several values, in particular, this is the structure:
Nations -> Championships (child of each nation) -> Teams (childs of each championship).
For Nation that's a root node I execute a method that perform particular task, the same for championship, but, how can I check if the user has select the Teams? So the child of a Championship?
Actually I do this:
TreeViewItem rootNode = (TreeViewItem)e.NewValue;
if (rootNode.Parent is TreeView)
{
soccerSeason.getChampionshipsForTeams(e);
}
else
{
teams.getTeam(e);
}
This working only for Nation and Championship, I want execute another method for each team selected, how I can do this? Because Actually if I select a child of Championship, was run the getTeam
method.