How to share the most code between a WPF and an ASP.NET MVC application?

后端 未结 7 1730
野性不改
野性不改 2021-02-19 06:20

What architecture and patterns can I use to share the most model and logic code between a WPF and an ASP.NET MVC application?

I am trying to achieve a bit more here than

7条回答
  •  悲&欢浪女
    2021-02-19 06:43

    Starting with the obvious. Encapsulate your business logic and domain model in a separate assembly.

    In terms of Presentation Layers and shared UI Behaviour, the closest you will get is the MVVM design paradigm, implementation will be C# in WPF/XAML and Javascript for your ASP.NET MVC web frontend.

    For the web frontend you can get close to the WPF (MVVM) way of doing things with http://knockoutjs.com/ written by Steve Sanderson of Microsoft. Its MVVM for the browser. Also checkout http://www.asp.net/mvc/mvc4 for more info.

提交回复
热议问题