两个步骤:1、添加以下两个程序集System.Windows.InteractivityMicrosoft.Expression.Interactions 2、添加xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
xmlns:ei="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
 <CheckBox >
                                <CheckBox.DataContext>
                                    <vm:StudentListViewModel></vm:StudentListViewModel>
                                </CheckBox.DataContext>
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="Checked">
                                        <ei:CallMethodAction TargetObject="{Binding }" MethodName="Select">
                                        </ei:CallMethodAction>
                                    </i:EventTrigger>
                                    <i:EventTrigger EventName="Unchecked">
                                        <ei:CallMethodAction TargetObject="{Binding }" MethodName="UnSelect"></ei:CallMethodAction>
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </CheckBox>

 <Button Content="View" Name="button1" Width="150" IsEnabled="{Binding CanSubmit}">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <ei:CallMethodAction TargetObject="{Binding}" MethodName="Submit"></ei:CallMethodAction>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </Button>                                                       

//CallMethodAction 操作来调用为指定对象定义的方法。所调用的方法必须是不采用参数并且不返回值的公共方法,或是其签名与事件处理程序的签名相匹配的公共方法。                           

Windows phone 之Interaction.Triggers的使用的更多相关文章

  1. Interaction triggers in WPF

    Interaction Class - static class that owns the Triggers and Behaviors attached properties. Handles p ...

  2. toolkit:Accordion DataTemplate ListBox TextBlock Interaction.Triggers

    困扰好几个小时的问题终于解决了,本人系菜鸟,使用MVVM设计模式,绑定DataTemplate的Command,需要使用 DataContent的资源,否则无法触发ICommand ClickChil ...

  3. WPF 事件触发命令

    方法一使用mvvmlight: xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Int ...

  4. (WPF) Textbox 每次输入触发事件处理

    1.  Code behind. protected void TextBox1_TextChanged(object sender, EventArgs e) { Label1.Text = Ser ...

  5. 从PRISM开始学WPF(九)交互Interaction?

    0x07交互 这是这个系列的最后一篇了,主要介绍了Prism中为我们提供几种弹窗交互的方式. Notification通知式 Prism通过InteractionRequest 来实现弹窗交互,它是一 ...

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

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

  7. 【C#/WPF】如何查看System.Windows.Interactivity.dll中EventTrigger的EventNames属性有哪些

    WPF项目中,从Nuget搜索并下载System.Windows.Interactivity.dll,安装到项目中,并在XAML界面引入. <UserControl xmlns:i=" ...

  8. Windows phone 8 触发器使用小结

    引用空间: xmlns:ec="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expres ...

  9. Windows 托盘区域显示图标

    NOTIFYICONDATA structure 这个结构体包含了向通知区域(底部任务栏右下角区域,下面都称为托盘)显示的信息.需要使用函数Shell_NotifyIcon. 结构体成员 typede ...

随机推荐

  1. [LeetCode] 16. 3Sum Closest 解题思路

    Given an array S of n integers, find three integers in S such that the sum is closest to a given num ...

  2. [TopCoder] SRM_594_DIV2.250

    好长一段时间没写博客了,实在是想不出有什么好写的.近期也有对自己的职业做了一点思考,还是整理不出个所以然来,很是烦躁 ... 研究TopCoder已经有一小段时间了,都是在做之前的题目,还没有实际参加 ...

  3. phpnow下mysqli加载不了的问题

    用了phpnow也有蛮长一段时间了.一直感觉还不错,不过就是差点把手动配置apache/php/mysql环境的方法都给忘了. 这几天一直都在找crm系统,可惜没有几个满意的.今天逛上了weberp这 ...

  4. 【转】谁说Vim不是IDE?(三)

    谁说Vim不是IDE?(三)   常用插件 之所以说Vim形成了自己的生态环境,就是因为Vim具备开放的插件体系,开发者为了提升开发效率,为Vim编写了数以万计的插件,我们可以根据需要任意选择,也可以 ...

  5. jni cocos2d-x移植到android:helloworld

    前面搭建好了android开发环境 jni开发环境,那么就来用一用目前火热的cocos2d的游戏引擎吧 所需资料: cocos2d :下载地址  http://www.oschina.net/p/co ...

  6. JSBinding+Bridge:逻辑代码中操作二进制数据

    以这2个函数为例 class File { public static byte[] ReadAllBytes(string path); public static void WriteAllByt ...

  7. 【转】SVN:Android Studio设置忽略文件

    Android Studio创建的Android项目一般需要忽略 参考: http://blog.csdn.net/qq_22780533/article/details/51965007 1..id ...

  8. BZOJ 3265 志愿者招募增强版 单

    标题效果:同1061 只是间隔为每种类型的志愿工作是多级 这是卡网络流量?未知 所有在所有的1061您将可以更改为在稍微改变- - #include <cmath> #include &l ...

  9. C和指针 (pointers on C)——第四章:语句(上)

    第四章--语句(上) 总结总结!!! C没有布尔类型,所以在一些逻辑推断时候必须用整型表达式,零值为假,非零值为真. for比while把控制循环的表达式收集起来放在一个地方,以便寻找. do语句比w ...

  10. Chapter 6 - How to Play Music and Sound Effect

    In this chapter, we would add background music to the game and play sound effect when the hero fires ...