public MainWindow()
{
CommandManager.AddExecutedHandler(this, ExecuteHandler);
}
void ExecuteHandler(object sender, ExecutedRoutedEventArgs e)
{
}
Error 1 Argument 2: cannot convert from 'method group' to 'System.Delegate'
public MainWindow()
{
CommandManager.AddExecutedHandler(this, ExecuteHandler);
}
void ExecuteHandler(object sender, ExecutedRoutedEventArgs e)
{
}
Error 1 Argument 2: cannot convert from 'method group' to 'System.Delegate'
I guess there are multiple ExecuteHandler with different signatures. Just cast your handler to the version you want to have:
CommandManager.AddExecuteHandler(this, (Action<object,ExecutedRoutedEventArgs>)ExecuteHandler);
CommandManager.AddExecutedHandler(this, (s, e) => ExecuteHandler(s, e));