How to implement DI and IoC in Win8 App? In windows form if I needed a form with dependencies I passed in the constructor (Constructor Injection) But with Page how do you? If I build a page with this constructor (
HomePage myPage = new HomePage (MyService1 ms, MyService2 ms))
then the
Navigate (typeof (HomePage))
how can I pass arguments?
您可以使用解决问题Content
的Frame
,而不是Source
:
myFrame.Content = new HomePage (MyService1 ms, MyService2 ms);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.