100分!WPF 的有关问题 请们进来看看 比较急
100分求助!!!WPF 的问题 请大虾们进来看看 比较急!!!
WPF程序采用了MVVM模式编程 ,在程序设计中我需要往ICommand传window窗体参数,可是当我绑定参数后,vs2010设计器就报错,不能显示正常的设计界面,如下图

把我代码贴出来,麻烦大虾们帮忙解决
RelayCommand.cs
ViewModelBase.cs
WPF程序采用了MVVM模式编程 ,在程序设计中我需要往ICommand传window窗体参数,可是当我绑定参数后,vs2010设计器就报错,不能显示正常的设计界面,如下图
把我代码贴出来,麻烦大虾们帮忙解决
RelayCommand.cs
public class RelayCommand<T>:ICommand
{
//定义执行命令成员和是否可执行命令成员
readonly Action<T> _execute;
readonly Func<T,bool> _canExecute;
//构造函数
public RelayCommand(Action<T> execute)
: this(execute, null)
{
}
public RelayCommand(Action<T> execute, Func<T,bool> canExecute)
{
if (execute == null)
throw new ArgumentNullException("RelayCommand执行命令不可预知");
_execute = execute;
_canExecute = canExecute;
}
public bool CanExecute(T parameter)
{
return _canExecute == null ? true : _canExecute(parameter);
}
public event EventHandler CanExecuteChanged
{
add { CommandManager.RequerySuggested += value; }
remove { CommandManager.RequerySuggested -= value; }
}
public void Execute(T parameter)
{
_execute(parameter);
}
public bool CanExecute(object parameter)
{
return _canExecute == null ? true : _canExecute((T)parameter);
}
public void Execute(object parameter)
{
_execute((T)parameter);
}
}
ViewModelBase.cs
public abstract class ViewModelBase : INotifyPropertyChanged,IDisposable
{
protected ViewModelBase() { }