wpf MVVM疑问 求帮忙解析 谢谢!

初学者 希望能通俗一点解析 谢谢! 代码: viewModel 继承了NotificationObject 这个就是  当属性值set 执行一个方法 RaisePropertyChanged  叫依赖属性。   同理需要一个命令属性 什么一个委托和委托对应的方法 class MainWindowViewModel : NotificationObject { private double input1; public double Input1 { get { return input1; } set { input1 = value; this.RaisePropertyChanged("Input1"); } } private double input2; public double Input2 { get { return input2; } set { input2 = value; this.RaisePropertyChanged("Input2"); } } private double result; public double Result { get { return result; } set { result = value; this.RaisePropertyChanged("Result"); } } public DelegateCommand AddCommand { get; set; }private void Add(object parameter) { this.Result = this.Input1 + this.Input2; } public MainWindowViewModel() { this.AddCommand = new DelegateCommand(); this.AddCommand.ExecuteAction = new Action(this.Add); } ICommand是定义一个命令 下面有2个方法和一个事件 class DelegateCommand : ICommand { public bool CanExecute(object parameter) { if (this.CanExecuteFunc == null) { return true; } return this.CanExecuteFunc(parameter); } public event EventHandler CanExecuteChanged; public void Execute(object parameter) { if (this.ExecuteAction == null) { return; } this.ExecuteAction(parameter); } public Action ExecuteAction { get; set; } public Func CanExecuteFunc { get; set; } } html绑定