全部,
我已经定义了以下
xmlns:default="clr-namespace:dotDiff2013"
xmlns:commands="clr-namespace:dotDiff2013.Commands"
<Window.CommandBindings>
<CommandBinding Command="commands:ComparerCommands.NewComparison"
Executed="NewComparison"/>
</Window.CommandBindings>
dotDiff2013.Commands
我在命名空间中的哪个位置
namespace dotDiff2013.Commands
{
public class ComparerCommands
{
static ComparerCommands()
{
InputGestureCollection inputs = new InputGestureCollection();
inputs.Add(new KeyGesture(Key.N, ModifierKeys.Control, "Ctrl+N"));
newComparison = new RoutedUICommand(
"New Document Comparison", "NewComparison", typeof(ComparerCommands), inputs);
}
private static RoutedUICommand newComparison;
public static RoutedUICommand NewComparison
{
get { return newComparison; }
}
}
}
但我收到以下错误
我究竟做错了什么?
我是 WPF 的新手,这个错误令人困惑,因为我已经做了正确的事情。任何建议将不胜感激。