public RegisterCommand ( string commandKey, Func |
||
commandKey | string | |
commandProvidingMethod | Func |
|
Résultat | void |
public void RegisterCommand(string commandKey, Func<ICommand> commandProvidingMethod)
{
if (!this.commandMap.ContainsKey(commandKey))
{
this.commandMap.Add(commandKey, commandProvidingMethod);
}
}
/// <summary> /// Provides loading for the wpf module exports. /// </summary> public override void Load() { this.AppKernel.Bind<ICommandFactory>().ToMethod(x => { var newCmdFactory = new CommandFactory(); newCmdFactory.UnregisterCommand(WpfExitCommandKey); newCmdFactory.RegisterCommand(WpfExitCommandKey, WpfProviderMethod); return newCmdFactory; }); }