WPF项目中,从Nuget搜索并下载System.Windows.Interactivity.dll,安装到项目中,并在XAML界面引入。

<UserControl

    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity">

....

</UserControl>

在目标UI控件上添加一个鼠标右键点击弹起事件。

    <!-- 鼠标右键事件 -->
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseRightButtonDown">
<!-- 激发ViewModel中自定义的ICommand命令,同时演示如何传参 -->
<i:InvokeCommandAction
Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.MouseRightButtonDownCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorLevel=1, AncestorType={x:Type Button}}}"/>
</i:EventTrigger>
</i:Interaction.Triggers>

现在的问题是:在Visual Studio中书写EventTrigger的EventName时,没有智能提示的,如何查看这里还能写哪些可选的事件?

可选的事件有以下这些:


重要的参考:

https://stackoverflow.com/questions/22060381/is-there-a-list-available-for-eventtrigger-eventnames

【C#/WPF】如何查看System.Windows.Interactivity.dll中EventTrigger的EventNames属性有哪些的更多相关文章

  1. “System.Runtime.InteropServices.COMException”类型的第一次机会异常在 System.Windows.Forms.dll 中发生

    最近做一个winform项目,在里面用了webbrowser控件进行html文档打印,遇到了标题所示问题.根据查到的一些资料,在调试>异常>查找中输入“System.Runtime.Int ...

  2. 【WPF/WAF】使用System.Windows.Interactivity交互事件

    下载System.Windows.Interactivity.dll文件,并引入项目中(在VS项目的引用列表中可以看到).可在Nuget搜索System.Windows.Interactivity下载 ...

  3. WPF中使用System.Windows.Interactivity实现事件绑定的替代方法

    一.问题描述 对于 Button 等控件,在 MVVM 中我们能通过 Command 绑定解决 Click 事件.具体如下所示: <Button Margin="10" He ...

  4. 用 .NET Reflector 8 查看 System.Windows.Controls 命名空间下的类

    为了学习自定义控件,就想看看WPF基本元素的代码.使用到工具.NET Reflector. System.Windows.Controls 命名空间在PresentationFramework.dll ...

  5. 解决引用 System.Windows.Interactivity程序集生成多国语言文件夹fr、es、ja等问题

    原文:解决引用 System.Windows.Interactivity程序集生成多国语言文件夹fr.es.ja等问题 通过以下方式对 System.Windows.Interactivity程序集添 ...

  6. ArgumentException: The Assembly Mono.WebBrowser is referenced by System.Windows.Forms ('Assets/Plugins/System.Windows.Forms.dll'). But the dll is not allowed to be included or could not be found.

    最近有个项目要用到System.Windows.Forms.dll,在Unity编辑器里用着还好好的,但是一导出就给我报错,让我十分不爽. 于是请教百度,搜出了五花八门的答案,没一个能解决我的问题的, ...

  7. System.Runtime.Serialization.SerializationException”类型的未经处理的异常在 System.Runtime.Serialization.dll 中发生

    异常信息: “System.Runtime.Serialization.SerializationException”类型的未经处理的异常在 System.Runtime.Serialization. ...

  8. WPF关于“在“System.Windows.Markup.StaticResourceHolder”上提供值时引发了异常。”问题解决办法

    在WPF中添加样式,在MainWindow.xaml使用自定义按钮FButton时报错,报错信息如下: "System.Windows.Markup.XamlParseException&q ...

  9. System.ComponentModel.DataAnnotations.Schema.TableAttribute 同时存在于EntityFramework.dll和System.ComponentModel.DataAnnotations.dll中

    Entity Framework 与 .net4.5 的 System.ComponentModel.DataAnnotations 都有 System.ComponentModel.DataAnno ...

随机推荐

  1. result-charts

    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding= ...

  2. Spring +Mybatis 企业应用实战(脑图)

  3. PHP中的一些安全配置

    PHP中的配置至关重要,包含php.ini的配置,还有系统权限的配置,一下是我总结的一些配置 一.PHP的模块 ./configure \ --with-libdir=lib64 \ --prefix ...

  4. ORA-04089: 无法对 SYS 拥有的对象创建触发器

    ORA-04089: 无法对 SYS 拥有的对象创建触发器 http://bbs.csdn.net/topics/390355220 猛然发现自己是用sys用户创建表空间,创建用户,赋权,顺手就把sq ...

  5. HDUOJ----Super Jumping! Jumping! Jumping!

    Super Jumping! Jumping! Jumping! Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K ...

  6. HTML:关于HTML的Doctype和严格模式与混杂模式

     DOCTYPE标签是一种标准通用标记语言的文档类型声明,它的目的是要告诉标准通用标记语言解析器,它应该使用什么样的文档类型定义(DTD)来解析文档. Doctype可声明三种DTD类型,分别表示严格 ...

  7. Hadoop Streaming

    原文地址:http://hadoop.apache.org/docs/r1.0.4/cn/streaming.html Hadoop Streaming Streaming工作原理 将文件打包到提交的 ...

  8. GL_子模组过账至总账通过SLA修改会计方法改变科目(案列)

    2014-06-02 BaoXinjian

  9. OAF_OAF组件系列1 - Item Style汇总(概念)

    20150506 Created By BaoXinjian

  10. Linux中断 - IRQ Domain介绍

    一.概述 在linux kernel中,我们使用下面两个ID来标识一个来自外设的中断: 1.IRQ number.CPU需要为每一个外设中断编号,我们称之IRQ Number.这个IRQ number ...