.net - Injection of ViewModels without a Service Locator -


i think service locator anti-pattern, find common see "viewmodellocator" each view takes datasource in xaml-based applications.

how avoided?

you can use mvvm framework uses conventions, caliburn.micro. in caliburn, register viewmodel di container when app starts. when have testview automatically bound testviewmodel (convention name, framework looks viewmodel in di container, gets/creates instance , binds it.).


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -