Click here to Skip to main content
15,888,803 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
how can i generate events and bind it to the view model in wpf mvvm.
I tried event trigger. But it was not working fine.
Give me solution with it's xaml code and also which namespaces needed for it.
Posted
Comments
Sergey Alexandrovich Kryukov 1-Dec-15 14:24pm    
It actually depends on what you want to achieve with that. "Not working fine" is not informative at all. See also my comment to the Solution 1.
—SA

1 solution

You can use the Loaded or ContentRendered event of the Window from xaml code.
Same is explained at below link.
http://stackoverflow.com/questions/18452756/whats-the-difference-between-the-window-loaded-and-window-contentrendered-event[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 1-Dec-15 14:27pm    
I up-voted it with 4, because one of the most likely useful events is mentioned, but truly correct answer should include magic words "it depends on what you want to achieve", which would be the most important part of the answer. The thing is: there is a number of different stages in a window life cycle, one capturing one of them would be good for one purpose and not suitable for another purpose, due to the number of subtleties.
—SA

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