wpf 微软用于 MVVM 的 ViewModelBase 类?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13053264/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Microsoft's ViewModelBase class for MVVM?
提问by user316117
For WPF programming with MVVM most people seem to write their own ViewModelBase class and other MVVM framework classes, or use one of the many third-party ones. But the other day I was googling for something and I found this on the MSDN -
对于使用 MVVM 的 WPF 编程,大多数人似乎编写自己的 ViewModelBase 类和其他 MVVM 框架类,或者使用众多第三方类中的一种。但前几天我在谷歌上搜索一些东西,我在 MSDN 上找到了这个 -
http://msdn.microsoft.com/en-us/LIBRARY/hh721872%28v=vs.110%29
http://msdn.microsoft.com/en-us/LIBRARY/hh721872%28v=vs.110%29
... so does Microsoft already supply an MVVM framework, or is this something new for Visual Studio 2012? It says Visual Studio 2012 in the corner but I didn't know if that meant newfor VS 2012. (I have VS 2010)
...那么微软是否已经提供了一个 MVVM 框架,或者这是 Visual Studio 2012 的新东西?它在角落里说 Visual Studio 2012,但我不知道这是否意味着VS 2012 的新功能。(我有 VS 2010)
Is this something I can use instead of writing my own or downloading a 3rd party one?
这是我可以使用而不是自己编写或下载第 3 方的东西吗?
Thanks in advance.
提前致谢。
采纳答案by user316117
If you take a trip up the namespace hierarchy
如果您在命名空间层次结构中进行一次旅行
http://msdn.microsoft.com/en-us/LIBRARY/bb130146.aspx
http://msdn.microsoft.com/en-us/LIBRARY/bb130146.aspx
You can see these types are designed for use when extending Team Foundation Server. So, no, this is not meant to be used for your WPF applications.
您可以看到这些类型是为在扩展 Team Foundation Server 时使用而设计的。所以,不,这并不意味着用于您的 WPF 应用程序。
However, you probably couldcreate WPF applications which use these types. But then, I'm not sure if the licensing for these assemblies would allow you to deploy them on a machine without TFS, or if you can deliver the assemblies outside of the SDK installer. A quick search didn't reveal anything. Probably the SDK has licensing details, which I don't currently have installed.
但是,您可能可以创建使用这些类型的 WPF 应用程序。但是,我不确定这些程序集的许可是否允许您在没有 TFS 的机器上部署它们,或者您是否可以在 SDK 安装程序之外交付程序集。快速搜索没有发现任何东西。SDK 可能有许可详细信息,我目前尚未安装。
Assuming you can and they do, does the effort this has already cost overcome replacing code which is, essentially, trivial to write? Or that has been written tens of times in different frameworks, practically all of which are available through NuGet?
假设您可以并且他们确实可以,那么这已经花费的努力是否可以克服替换代码的问题?或者已经在不同的框架中编写了数十次,实际上所有这些都可以通过 NuGet 获得?

