Question

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?

Was it helpful?

Solution

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

myFrame.Content = new HomePage (MyService1 ms, MyService2 ms);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top