Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
138 views
in Technique[技术] by (71.8m points)

c# - Visual Studio 2017 - What happened to Expression interactions?

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

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?

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

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.

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...