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?

有帮助吗?

解决方案

You can solve the problem using the Content of Frame instead of Source :

myFrame.Content = new HomePage (MyService1 ms, MyService2 ms);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top