Inject dependencies from Application into each new PhoneApplicationPage
My Application
o开发者_StackOverflow中文版bject owns object X. Whenever instances of PhoneApplicationPage
are created, I want to inject a reference to X into them. Where can I plug in to do that?
The best way I've found so far is to use the RootFrame.Navigated
event, but that of course executes upon each navigation, not only when the page objects are created.
Have a look at:
http://funq.codeplex.com/
https://msmvps.com/blogs/vcsjones/archive/2010/11/25/a-really-super-light-and-simple-ioc-container-for-windows-phone-7.aspx
http://www.simonrhart.com/2010/03/implementing-ioc-container-in.html
精彩评论