WPF design question (custom control or mvvm)

穿精又带淫゛_ 提交于 2019-12-06 02:46:58

I would definitely use the MVVM pattern. You get a very nice separation of concerns in your code, and your viewmodel can also be tested outside of the user interface. You may also be able to edit you view in Blend. I don't think that hooking up the viewmodel to the backend is more complicated than hooking up a custom control. You may decide to use dependency injection or a service locator to connect things. By using all these design patterns you get a more decoupled and testable solution.

I'd love to know more about CustomControls but in the mean time I think the best option is to use a UserControl as a DataTemplate:

http://www.codeproject.com/Articles/28060/WPF-UserControl-DataTemplate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!