基类NotificationObject class NotificationObject:INotifyPropertyChanged //ViewModel的基类,作用是通知ViewModels的变化 { public event PropertyChangedEventHandler PropertyChanged; public void RaisePropertyChanged(string propertyName) { if (this.PropertyChanged!=null) { this.PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } } 简单基类DelegateCommand class DelegateCommand:ICommand { public boolCanExecute(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