(Download link: http://www.4shared.com/file/VrKkQQkH/TestWPFApps.html)

I just started to work on WPF after quite a long break (8 months). And I wanted to recap my WPF knowledge and use MVVM in a plugin like scenario.

I have prepared a very basic plugin like app which makes use of MVVM with Commands, DataBindings and DataTemplates.

The AnimalsLibrary is a Plugin base which is referenced by every plugin.

The OuterUserAnimals is a Plugin which creates a new animal type. It also defines its own way of displaying its animals using a data template.

The TestListBoxTemplate is our main app which displays the standard animals and loads other animals from plugin DLL.

For now, you may find the path of plugin DLL hard coded so you would have to change that to match your needs (as per your save location of the zip).

This example shows how to create a ViewModel which can be bound to a view. How to create and load DataTemplates from a referenced DLL (animals lib), and how to create & load DataTemplates in a plugin lib which is usually loaded using reflection.

This example also shows how to use ICommand in a DataTemplate.

If you find any issues running the sample, drop me a comment and I would be happy to help.

Happy coding!!

推荐.NET配套的通用数据层ORM框架:CYQ.Data 通用数据层框架
新浪微博粉丝精灵,刷粉丝、刷评论、刷转发、企业商家微博营销必备工具"