Вопрос

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