How to Raize Command to evalituate in mvvm

  1. In mvvmlight, we bind our control to the relaycommand object. But, the commmand only execute the CanExecute() onetime, if some specifies changed, how could we notify the control to re-evaluate.

    Im mvvm light, we can find, two elements in RelayCommand: event CanExecuteChanged, RaiseCanExecuteChagned(), so we can add our customized event handles to the event, and we can call the RaiseCanExecuteChanged() function to raise the event,

Sample code:

 public int Index
{
get
{
return _index;
}
set
{
_index = value;
RaisePropertyChanged("");
((RelayCommand<string>)BackCommand).RaiseCanExecuteChanged();
((RelayCommand<string>)NextCommand).RaiseCanExecuteChanged(); }
}

How to Notify Command to evaluate in mvvmlight的更多相关文章

  1. Centos命令行窗口显示一大串前缀,777;notify;Command completed;的解决方法

    How to remove the return code from the terminal prompt In addition to the PS1 environment variable, ...

  2. MVVM、MVVMLight、MVVMLight Toolkit之我见

    原文:MVVM.MVVMLight.MVVMLight Toolkit之我见 我想,现在已经有不少朋友在项目中使用了MVVMLight了吧,如果你正在做WPF,Silverlight,Windows ...

  3. 【php】使用phpdbg来调试php程序

    PHPDBG是一个PHP的SAPI模块,可以在不用修改代码和不影响性能的情况下控制PHP的运行环境 可以在PHP5.4和之上版本中使用.在PHP5.6和之上版本将内部集成 功能 单步调试 灵活的下断点 ...

  4. motan源码分析十:流量切换

    motan提供了流量切换的功能,可以实现把一个group的流量切换到另一个group(一个或多个服务都可以).大家可以使用tomcat部署motan的管理工具,并设置几个组,例如可以参考demo代码: ...

  5. 深入浅出低功耗蓝牙(BLE)协议栈

    深入浅出低功耗蓝牙(BLE)协议栈 BLE协议栈为什么要分层?怎么理解蓝牙"连接"?如果蓝牙协议只有ATT没有GATT会发生什么? 协议栈框架 一般而言,我们把某个协议的实现代码称 ...

  6. postgreSQL PL/SQL编程学习笔记(一)

    1.Structure of PL/pgSQL The structure of PL/pgSQL is like below: [ <<label>> ] [ DECLARE ...

  7. MSDN上关于WinDbg的手册

    参考:http://msdn.microsoft.com/en-us/library/windows/hardware/ff540507(v=vs.85).aspx 这是最靠谱的参考了,比.hh要直观 ...

  8. 蓝牙 BLE 协议学习: 001-BLE协议栈整体架构

    背景 在深入BLE协议帧之前,我们先看一下BLE协议栈整体架构. 转载自:<深入浅出低功耗蓝牙(BLE)协议栈> 架构 如上图所述,要实现一个BLE应用,首先需要一个支持BLE射频的芯片, ...

  9. Deformable 可变形的DETR

    Deformable 可变形的DETR This repository is an official implementation of the paper Deformable DETR: Defo ...

随机推荐

  1. SQO (标准查询运算符)方法 & Linq To Object

    #region SQO (标准查询运算符) 方法 #region Where() Find() FindAll() FirstOrDefault()等方法 static void c01where() ...

  2. android Tab =viewpager+fragmnet

    1.定义几个fragment 的subclass 如fragmentone,fragmenttwo; public class fragmentthree extends Fragment { pri ...

  3. AX 用代码创建FORM动态加控件,重载动态添加的控件的方法。

    eg. 范例:class\RFIDReadWriteForm/Build方法. formRun.controlMethodOverload(true); formRun.controlMethodOv ...

  4. IRS-P6数据介绍

    IRS-P6发射于2003年10月17日,星上携带三个传感器:多光谱传感器LISS4和LISS3,以及高级广角传感器AWIFS.LISS3传感器具有四个光谱波段分别位于可见光.近红外与短波红外区域,空 ...

  5. NSString常见用法总结

    //====================NSStirng 的常见用法==================== -(void)testString { //创建格式化字符串:占位符(由一个%加一个字 ...

  6. DOM 中 Property 和 Attribute 的区别

    原文地址:http://web.jobbole.com/83129/ property 和 attribute非常容易混淆,两个单词的中文翻译也都非常相近(property:属性,attribute: ...

  7. linux内核中的min(x, y)和max(x, y)宏定义

    /linux/include/linux/kernel.h中有min(x, y)和max(x, y)的定义如下: #define min(x, y) ({ \ typeof(x) _min1 = x; ...

  8. css3 2d

    CSS3 2D 转换   通过 CSS3 转换,我们能够对元素进行移动.缩放.转动.拉长或拉伸. 以下是 2D 转换 1 translate()通过 translate() 方法,元素从其当前位置移动 ...

  9. 三个有用的SQL辅助工具

    三个有用的SQL辅助工具 编写人:CC阿爸 2015-1-23 工欲善其事必先利其器,今天在这里,我想与大家一起分享三个有用的SQL辅助工具.有兴趣的同学,可以一同探讨与学习一下,否则就略过吧. 相信 ...

  10. AppSetting ,connectionStrings配置节

    <appSettings> <!-- 当前使用的学校代码 --> <add key="DefaultCompanyID" value="cs ...