Visual Studio 2017-表达式交互发生了什么? [英] Visual Studio 2017 - What happened to Expression interactions?

查看:91
本文介绍了Visual Studio 2017-表达式交互发生了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我大量使用Expression交互的CallMethodAction以对MVVM友好的方式处理XAML中的事件.

I make extensive use of Expression interactions' CallMethodAction to handle events from XAML in a MVVM-friendly way.

我刚刚在VS2017中创建了一个新的WPF项目,现在我看到旧的Expression命名空间已经消失了.我发现此页面在MSDN上,这是我要查找的操作,但是在引用该程序集并添加名称空间后,它不包含CallMethodAction.该页面用于Silverlight,这是WPF,因此我担心操作不再可用.

I have just created a new WPF project in VS2017 and now I see the old Expression namespace is gone. I found this page on MSDN which is the action I'm looking for but after referencing that assembly and adding the namespace it does not contain the CallMethodAction. That page is for Silverlight and this is WPF, so I'm concerned that action is no longer available.

那么有人知道它是否实际上已被删除/替换了吗?现在应该如何在视图模型上调用事件处理程序?

So does anyone know if it has in fact been removed/replaced? How is one supposed to call event handlers on the viewmodel now?

(我确实了解InvokeCommandAction,但我更喜欢CallMethodAction,因为它可以传递原始事件参数,并允许取消预览事件.)

(I do know about InvokeCommandAction, but I prefer CallMethodAction since it relays the original event arguments, and allows for canceling preview events.)

编辑:为了向前发展,我尝试了InvokeCommandAction,但是它不再以相同的方式工作,并且我找不到有关新用法的任何文档.

Edit: Just to move forward I tried InvokeCommandAction but it no longer works the same way either and I cannot find any documentation on the new usage.

我确实找到了 MSDN上对Microsoft.Xaml.Interactions命名空间的引用,该命名空间似乎包含我需要的类,但该程序集似乎不存在.

I did find this reference on MSDN for the Microsoft.Xaml.Interactions namespace which appears to contain the classes I need, but that assembly doesn't appear to exist.

我觉得这里缺少明显的东西.我看不到他们如何对响应事件这样的基本内容做出重大改变.

I feel like I'm missing something obvious here. I don't see how they could make a breaking change to something as basic as responding to events.

推荐答案

使用Visual Studio 2017安装程序安装"Blend for Visual Studio SDK for .NET",您可以在单个组件"页上的""SDK,库和框架"标题.

Use the Visual Studio 2017 installer to install "Blend for Visual Studio SDK for .NET", which you can find on the "Individual components" page, under the "SDKs, libraries, and frameworks" heading.

这篇关于Visual Studio 2017-表达式交互发生了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆