Windows phone 之Interaction.Triggers的使用
两个步骤: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的使用的更多相关文章
- Interaction triggers in WPF
Interaction Class - static class that owns the Triggers and Behaviors attached properties. Handles p ...
- toolkit:Accordion DataTemplate ListBox TextBlock Interaction.Triggers
困扰好几个小时的问题终于解决了,本人系菜鸟,使用MVVM设计模式,绑定DataTemplate的Command,需要使用 DataContent的资源,否则无法触发ICommand ClickChil ...
- WPF 事件触发命令
方法一使用mvvmlight: xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Int ...
- (WPF) Textbox 每次输入触发事件处理
1. Code behind. protected void TextBox1_TextChanged(object sender, EventArgs e) { Label1.Text = Ser ...
- 从PRISM开始学WPF(九)交互Interaction?
0x07交互 这是这个系列的最后一篇了,主要介绍了Prism中为我们提供几种弹窗交互的方式. Notification通知式 Prism通过InteractionRequest 来实现弹窗交互,它是一 ...
- 【WPF/WAF】使用System.Windows.Interactivity交互事件
下载System.Windows.Interactivity.dll文件,并引入项目中(在VS项目的引用列表中可以看到).可在Nuget搜索System.Windows.Interactivity下载 ...
- 【C#/WPF】如何查看System.Windows.Interactivity.dll中EventTrigger的EventNames属性有哪些
WPF项目中,从Nuget搜索并下载System.Windows.Interactivity.dll,安装到项目中,并在XAML界面引入. <UserControl xmlns:i=" ...
- Windows phone 8 触发器使用小结
引用空间: xmlns:ec="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expres ...
- Windows 托盘区域显示图标
NOTIFYICONDATA structure 这个结构体包含了向通知区域(底部任务栏右下角区域,下面都称为托盘)显示的信息.需要使用函数Shell_NotifyIcon. 结构体成员 typede ...
随机推荐
- .net常見面試題(三)
1, 请你说说.NET中类和结构的区别? 答:结构和类具有大体的语法,但是结构受到的限制比类要多.结构不能申明有默认的构造函数,为结构的副本是又编译器创建和销毁的,所以不需要默认的构造函数和析构函数. ...
- Poj 2528-Mayor's posters 线段切割
题目:http://poj.org/problem?id=2528 Mayor's posters Time Limit: 1000MS Memory Limit: 65536K Total ...
- Installing Windows Identity Foundation on Windows 8 - The Certificate for the signer of the message is invalid or not found.
Just a very quick note here, in case you’re struggling to get Windows Identity Foundation installed ...
- opencv 中文文档地址
http://www.opencv.org.cn/opencvdoc/2.3.2/html/doc/tutorials/tutorials.html
- Code Forces 711C Coloring Trees
C. Coloring Trees time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...
- Collections.sort的两种用法 转
/** * @author guwh * @version 创建时间:2011-11-3 上午10:49:36 * 类说明 */ package com.jabberchina.test; impor ...
- oralce11 过程
PL/SQL 块的结构和实例 pl/sql(procedural language(过程化语言)/sql)是oracle在标准的sql语言上的扩展.pl/sql不仅允许嵌入sql语言,还可以定义变量和 ...
- TCP keepalive
2. TCP keepalive overview In order to understand what TCP keepalive (which we will just call keepa ...
- A Cross-Platform Memory Leak Detector
Memory leakage has been a permanent annoyance for C/C++ programmers. Under MSVC, one useful feature ...
- hdu2073递推题
无限的路 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submissio ...