Xceed.Wpf.Toolkit.DropDownButton.HookUpCommand C# (CSharp) Method

HookUpCommand() private method

Hooks up a command to the CanExecuteChnaged event handler.
private HookUpCommand ( ICommand oldCommand, ICommand newCommand ) : void
oldCommand ICommand The old command.
newCommand ICommand The new command.
return void
    private void HookUpCommand( ICommand oldCommand, ICommand newCommand )
    {
      EventHandler handler = new EventHandler( CanExecuteChanged );
      canExecuteChangedHandler = handler;
      if( newCommand != null )
        newCommand.CanExecuteChanged += canExecuteChangedHandler;
    }