摘要: 在这里我打算分享一个十分轻量级的技巧实现Silverlight4中的Command。Step 1 – 实现ICommand接口第一步是新建一个类来管理Command相关的逻辑,它需要实现ICommand接口。当然,还有很多其他的方式,我在这里只介绍这种简单有效的实现。DelegatedCommand类实现了ICommand接口定义的CanExecute、Execute方法和CanExecuteChanged事件。public class DelegateCommand : ICommand { Func<object, bool> canExecute; Action<obj 阅读全文
posted @ 2011-04-30 17:53 zhh 阅读(207) 评论(0) 推荐(0) 编辑