MVVM Light如何在WPF用户控件库项目中使用? [英] How can MVVM Light be used in a WPF User Control Library project?

查看:127
本文介绍了MVVM Light如何在WPF用户控件库项目中使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

具体来说,我想知道如何将视图模型绑定到用户控件.到目前为止,我能够找到的示例都是WPF应用程序或WPF浏览器应用程序项目.甚至工具箱中的模板也适用于WPF应用程序或WPF浏览器应用程序项目.我正在使用Visual Studio 2010.

Specifically, I would like to know how the view model is to be bound to a user control. The examples I have been able to find so far are all WPF Application or WPF Browser Application projects. Even the templates in tool kit are for WPF Application or WPF Browser Application projects. I am using Visual Studio 2010.

推荐答案

找到了ff.在MVVM Light网站的评论中: http ://blog.galasoft.ch/posts/2010/03/whats-new-in-mvvm-light-v3/.基本上,代替App.xaml,视图模型定位器在用户控件中声明为资源.框架的创建者本人已经发言,所以我认为这一定是最好的方法:D

Found the ff. in the comments of MVVM Light's site: http://blog.galasoft.ch/posts/2010/03/whats-new-in-mvvm-light-v3/. Basically, in lieu of App.xaml, the view model locator is declared as a resource in the user control. The framework's creator himself has spoken so I suppose this must be the best approach :D

这篇关于MVVM Light如何在WPF用户控件库项目中使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆