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

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -