【问题标题】:MVVMLight and Windows 10MVVMLight 和 Windows 10
【发布时间】:2015-12-22 15:23:44
【问题描述】:

即将在通用 Windows 10 应用程序中尝试使用 MVVM。为了帮助我一直在使用 MVVMLight 工具包,它在代码中运行良好。但是,我想尝试 XAML 中的 EventToCommand 将列表视图上的 ItemClick 路由到命令,但似乎无法在命名空间中引用正确的库。

我尝试过xmlns:MvvmLight="using:GalaSoft.MvvmLight",但这似乎没有给我任何 EventToCommand 智能感知。 Windows 10 通用应用程序是否支持此功能?如果是这样,我如何在 XAML 中使用它?

【问题讨论】:

    标签: xaml mvvm mvvm-light win-universal-app


    【解决方案1】:

    我相信这段话:

    如上所述,Windows 8.1 中没有 EventToCommand MVVM Light 版本,永远不会有。这是因为 Blend 团队听取了我的反馈并添加了相同的功能 他们自己的 InvokeCommandAction。

    来自Using the EventArgsConverter in MVVM Light, and why is there no EventToCommand in the Windows 8.1 version? 回答您的问题并提供前进的方向......

    还可以查看这篇博文 Building a Universal Application for Windows Phone 8.1 and Windows 8.1 with MVVM Light,其中 Laurent Bugnion 在回答为什么 MVVM Light for Universal 中没有 EventToCommand 的问题时指出了同一篇博文。

    【讨论】:

      猜你喜欢
      • 2011-07-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-04
      • 2015-08-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多