【问题标题】:Does you know a MVVM Framework where support DialogService?你知道支持 DialogService 的 MVVM 框架吗?
【发布时间】:2023-04-09 01:59:02
【问题描述】:

我现在正在 WPF 应用程序中使用 Prism。但现在我觉得有必要使用DialogService,我想使用支持此功能的 MVVM 框架。

我不想实现我自己的DialogService. 提前致谢。

【问题讨论】:

    标签: c# wpf mvvm dialog prism


    【解决方案1】:

    如果DialogService 是指一种从 ViewModel 打开窗口而不用 View 层代码污染它的方法,则有 Caliburn Micro 项目。它以 WindowManager 类的形式提供具有标准实现的 IWindowManager。它具有 ShowWindowShowDialogShowPopup 方法,它们将 ViewModel 作为参数并自动创建并绑定 View。

    【讨论】:

    • 感谢您的回复。如果我混合使用这两个框架来使用这个功能(在 calliburn 的情况下)是不是很困难
    【解决方案2】:

    您可以自己轻松完成。看看this

    var result = this.uiDialogService.ShowDialog("Dialogwindow title goes here", dialogwindowVM);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-31
      相关资源
      最近更新 更多