【发布时间】:2011-11-07 19:31:30
【问题描述】:
我在玩 RoutedCommand,但在寻找如何传递参数以便我的 Executed 方法将它包含在 e 中时遇到问题.参数?
我的路由命令:
public static readonly RoutedCommand Foo = new RoutedCommand();
用法:
menuItem.Command = Commands.Foo;
执行:
private void Foo_Executed(object sender, ExecutedRoutedEventArgs e)
{
object parameter = e.Parameter; // this is always null
}
【问题讨论】:
标签: c# wpf c#-4.0 routed-commands