c# - MVVM Light SimpleIoc instance resolution -


in mvvm light display dialog having implement imodalwindow interface. register using

simpleioc.default.register<imodalwindow, dialogview>(); 

using method though cannot see how can register different dialogs implement same interface , request correct one. looked @ factory method not find suitable example.

instead used following

simpleioc.default.register<imodalwindow>(() => { return new dialogview(); }, "dialogview"); 

which allows me access specific dialog type via key, since singleton, error when attempt show dialog second time because instance has been closed.

this second method allows mock used unit testing registering same key.

how can register different dialogs simpleioc, non-singleton instances , able unit test?


Comments

Popular posts from this blog

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -