我们可以使用 MVC 或 MVP 创建 WPF 应用程序吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12034889/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 05:02:08  来源:igfitidea点击:

Can we create WPF application using MVC or MVP?

wpfwindowsmodel-view-controllermvp

提问by Rutav

In a interview,i had been asked to a question that, Can we create WPF application using MVC or MVP design pattern or practice. I said MVC or MVP is a design pattern to develop loosely coupled application. we'll use MVC,MVP or MVVM based on given scenario,context,technology and platform of application.

在一次采访中,我被问到一个问题,我们可以使用 MVC 或 MVP 设计模式或实践创建 WPF 应用程序。我说 MVC 或 MVP 是一种开发松散耦合应用程序的设计模式。我们将根据给定的应用场景、上下文、技术和平台使用 MVC、MVP 或 MVVM。

If We can Create WPF application using MVC or MVP,if you have any good example in form of code or PoC, then please share or explain.

如果我们可以使用 MVC 或 MVP 创建 WPF 应用程序,如果您有任何好的代码或 PoC 形式的示例,请分享或解释。

回答by pchajer

MVC, MVP and MVVM all are UI design pattern. There is no restriction on using these pattern with WPF. But if we are using MVVM pattern we can take advantage of WPF feature like data binding etc..

MVC、MVP 和 MVVM 都是 UI 设计模式。在 WPF 中使用这些模式没有限制。但是如果我们使用 MVVM 模式,我们可以利用 WPF 功能,如数据绑定等。

Reference: - MVVM vs MVP vs MVC

参考: - MVVM vs MVP vs MVC