public UICommand(Action commandAction, Func <bool> canExecute = null) { if (commandAction == null) { throw new ArgumentNullException(nameof(commandAction)); } m_CommandAction = new WeakAction(commandAction); if (canExecute != null) { m_CanExecute = new WeakFunc <bool> (canExecute); } }