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. Redis 2:简单使用

    导读:上一篇博客对于Redis进行了简单的介绍,本篇博客就浅显的说一下Redis的基本操作使用.本次测试的环境是window8.1,呃,没用Linux等其他系统,就下载的window环境的安装包. 一 ...

  2. Recover damage pictures to see the crime scene

    Few people know that when you take photos there is also a thumbnail embeded inside the file, even so ...

  3. 基于Vivado HLS在zedboard中的Sobel滤波算法实现

     基于Vivado HLS在zedboard中的Sobel滤波算法实现 平台:zedboard  + Webcam 工具:g++4.6  + VIVADO HLS  + XILINX EDK + ...

  4. zencart用chrome无法登录后台

    再本地安装完zencart后,可以使用ie和Firefox登录网站后台,但是使用chrome登录时,页面闪一下,然后又跳转到登录页面. 按如下设置可以解决该问题: 中文版:商店设置->Sessi ...

  5. Apache与Nginx的优缺点

    http://weilei0528.blog.163.com/blog/static/206807046201321810834431 Apache与Nginx的优缺点比较 1.nginx相对于apa ...

  6. 软件工程 speedsnail 冲刺8

    完成任务:蜗牛移动的界面调整,速度调整: 遇到问题: 问题1 进入关卡的开始蜗牛会跳一段距离 解决1 线程延迟3S: 明日任务: 划线实现挡板功能

  7. 数据包判断是否丢包 ping+tracert+mtr

    1.用咱们最常用的Ping命令来查看是不是真的丢包了 这里可以看到数据包发送了4个,返回了4个,丢失=0  证明没有丢失 也有可能中间路由做了策略不给ICMP的回应 这样就ping没法判断了  正常情 ...

  8. [leetcode]_Merge Sorted Array

    题目:合并两个有序数组A , B,将合并后的数组存到A中.假设A的空间足够装下A和B所有的元素. 思路:这道题考虑如果正向扫描两个数组,则每插入一个元素,则需移动A后的所有元素.换个角度想,既然元素个 ...

  9. Winform 打开下载的文件

    private void OpenFile(string filename) { ProcessStartInfo sInfo = new ProcessStartInfo(); sInfo.Wind ...

  10. linux 常用命令及技巧

    linux 常用命令及技巧 linux 常用命令及技巧:linux 常用命令总结: 一. 通用命令: 1. date :print or set the system date and time 2. ...