【问题标题】:Invoking a WPF command from a WPF-embedded Winforms control从 WPF 嵌入式 Winforms 控件调用 WPF 命令
【发布时间】:2011-01-14 21:17:15
【问题描述】:

我有一个从 Infragistics UltraGrid 扩展而来的 WinDataGrid 类。我已使用WindowsFormHostWinDataGrid 嵌入到WPF 用户控件中。选择行后,我需要使用我的所选行集合调用预定义的DelegateCommand<IList>

我该怎么做?

作为背景,我有一个同时使用 WPF DataGrid 和 Infragistics WinGrid 的 WPF 应用程序。 WPF 网格已经大部分连接起来了,我想尽可能多地利用现有的命令等来连接我的 Winforms 网格。我知道可能需要一些映射,但我应该能够映射大多数东西?

【问题讨论】:

    标签: c# wpf datagrid command winforms-interop


    【解决方案1】:

    如果DelegateCommandICommand,您可以调用Execute() 方法来调用命令。不要忘记首先检查是否允许使用CanExecute()执行命令

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-27
      • 2012-09-11
      • 2010-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多