public MainWindow()
{
CommandManager.AddExecutedHandler(this, ExecuteHandler);
}
void ExecuteHandler(object sender, ExecutedRoutedEventArgs e)
{
}
错误 1 参数 2:无法从“方法组”转换为“System.Delegate”
最佳答案
我猜有多个具有不同签名的 ExecuteHandler。只需将您的处理程序转换为您想要的版本:
CommandManager.AddExecuteHandler(this, (Action<object,ExecutedRoutedEventArgs>)ExecuteHandler);
关于c# - 如何修复 'compiler error - cannot convert from method group to System.Delegate' ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2479870/