【问题标题】:Is it possible to share a middle-ware project between WPF and UWP 10 apps?是否可以在 WPF 和 UWP 10 应用程序之间共享中间件项目?
【发布时间】:2015-11-05 23:17:02
【问题描述】:

假设我有以下项目的解决方案:

Presentation layer:  ProjectA1 (UWP 10)    ProjectA2 (WPF)
                           ↓                   ↓
Infrastructure-mid:  ProjectM1 (UWP 10)    ProjectM2 (.NET 4.6)
                           ↓                   ↓
Infrastructure-low:  ProjectL1 (UWP 10)    ProjectL2 (.NET 4.6)

演示项目肯定是特定于平台的,低级基础设施项目也是如此,因为它们分别利用了不同的 UI 和网络技术。 但是中级基础设施项目将是相同的,因为它们由简单的内部逻辑组成。

能否将两个中级项目合并为一个 PCL,由 UWP 和 WPF 应用共享,如下所示:

Presentation layer:  ProjectA1 (UWP 10)    ProjectA2 (WPF)
                           ↓                   ↓
Infrastructure-mid:  ===========ProjectM (PCL)============
                           ↓                   ↓
Infrastructure-low:  ProjectL1 (UWP 10)    ProjectL2 (.NET 4.6)

..然后使用依赖注入将适当的低级对象获取到常见的中级组件中?

【问题讨论】:

    标签: .net portable-class-library uwp


    【解决方案1】:

    是的。推荐使用这样的 PCL 在不同目标之间共享代码。

    【讨论】:

      猜你喜欢
      • 2019-04-05
      • 2015-07-13
      • 2011-03-24
      • 1970-01-01
      • 2011-08-29
      • 1970-01-01
      • 1970-01-01
      • 2018-07-22
      • 1970-01-01
      相关资源
      最近更新 更多