is there something similar to asp.net mvc for winf

2019-06-19 22:59发布

anybody knows something similar to asp.net mvc for winforms or wpf ?

5条回答
手持菜刀,她持情操
2楼-- · 2019-06-19 23:25

You could take a look at implementing Model-View-View Model in WPF.

It's not a Framework like .NET MVC, but at its core MVC is a pattern and MVVM is a close analog for WPF.

查看更多
在下西门庆
3楼-- · 2019-06-19 23:31

Well, MVC is a pattern, you can always organize your code in a MVC manner. I'm not quite sure what you are asking for(a framework or something like that... I'm not familiar with any kind of mvc framework for wpf, but this doesn't mean there isn't one), because there is no managing urls in winforms and wpf and the other cool stuff in asp.net-mvc.

If you want to code in WPF way I strongly recommend doing ig the MVVM way.

Here is the ultimate start for wpf mvvm - http://community.infragistics.com/pixel8/media/p/91950.aspx

查看更多
Lonely孤独者°
4楼-- · 2019-06-19 23:35

The most accepted (and in my opinion the most usable) pattern for developing WPF applications is MVVM (stands for Model-View-ViewModel).

You can read a quite broad introduction with a walkthrough here: http://msdn.microsoft.com/en-us/magazine/dd419663.aspx

查看更多
一纸荒年 Trace。
5楼-- · 2019-06-19 23:35

Well the way windows apps are set up actually makes sense, an event driven model can be used in an environment that maintains states. In contrast the amount of javascript hacking to emulate these "states" in webforms is insane. So MVC makes sense in the web because the web is stateless, in windows we have states and should use them. If what you really want is a web interface for your windows service or whatever, you can put a copy of casini in your installer and have them use the web interface without issue. Hope this helps.

查看更多
三岁会撩人
6楼-- · 2019-06-19 23:36

For winforms you can implement your own MVP (model view presenter) or MVC (model view controller patterns. There are also some frameworks like CAB (composite application block) that you can use http://msdn.microsoft.com/en-us/library/aa480450.aspx that are basicly a MVC pattern.

查看更多
登录 后发表回答