在 MVVM Light 工具包的帮助下,我刚刚开始使用和学习 mvvm 模式。我想在我的项目中使用 MVVM Light,但我不知道如何使用 ViewModelLocator。我没有得到它的用途。请提供样品或示例。
谢谢
在 MVVM Light 工具包的帮助下,我刚刚开始使用和学习 mvvm 模式。我想在我的项目中使用 MVVM Light,但我不知道如何使用 ViewModelLocator。我没有得到它的用途。请提供样品或示例。
谢谢
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.