更新时间:2022-12-20 21:07:19
实现此目标的典型方法是使用MVVM之类的模式,该模式将允许您定义通用模型和viewmodel层(也许在单独的项目中),定义引用该普通项目的其他视图层.
The typical way of achieving this is by using a pattern like MVVM which will allow you to define a common model and viewmodel layer (perhaps in a separate project) the defining a different view layer that references that common project.
您自己说的话,您只会共享大部分的代码,而不是全部,因此,至少在某些时候,您需要创建特定于设备/前端的逻辑和布局.
You said it yourself, you will only share MOST of the code, not all of it, so you will, at least at some time, need to create device/front-end specific logic and layout.