Click here to Skip to main content
15,907,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my WPF app, I have a main window containing a grid. I have a Login and a Shell User Control which are set as the Grid Children.

I want to start a timer in the main wondow on addition of the Shell, i.e. when the user logs in. I need to know as to what even is raised when a child is added to a grid, using the Grid.Children.Add method.
Posted

1 solution

You could possibly override Grid.OnVisualChildrenChanged[^] and run the necessary code in there.

Just remember to call the base method also!
 
Share this answer
 
Comments
hishaks 20-May-12 14:11pm    
Would be great if you can provide a code example...
Wendelius 20-May-12 14:30pm    
One example I found is here http://social.msdn.microsoft.com/Forums/ar/wpf/thread/00da4a81-f121-4c43-ac4b-7776a7af6e23[^]

Even though it's a question and contains a problem, it quite nicely shows how the method can be used.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900