Mvvm Light Command绑定

<Button Content="按钮" Command="{Binding ButtonCommand}"/>

        // 按钮点击命令
        public ICommand ButtonCommand
        {
            get
            {
                return new RelayCommand(
                    () => System.Windows.MessageBox.Show("当前时间:" + System.DateTime.Now.ToString())
                    );
            }
        }

posted @ 2012-02-10 14:46  Ken-Cai  阅读(350)  评论(0编辑  收藏  举报