views:

223

answers:

1

Hi,

I have just started to use and learn mvvm pattern with the help of MVVM Light toolkit. I want to use MVVM Light in my project but I dont know how to use ViewModelLocator. I am not getting what it is used for. Kindly suggest with samples or examples.

Thanks

+1  A: 

The locator is a repository of view models. You use it to get access to the view models in your application. The app.xaml defines a global instance of the locator, and individual views can bind their datacontext to properties of the locator which serve up the individual VMs. Check out my sample app to see how things are wired together.

Chris Koenig
Thanks. will see ur sample
Tarun