Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Command"/> class.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="canExecute">The function to execute to determine whether the command can execute.</param>
        /// <param name="execute">The execute action.</param>
        /// <exception cref="ArgumentException">When <paramref name="owner"/> is null.</exception>
        public Command(INotifyPropertyChanged owner, Func <object, bool> canExecute, Action <object> execute)
        {
            this.owner = owner.AssertParamterNotNull(nameof(owner));

            owner.PropertyChanged += this.OwnerOnPropertyChanged;
            this.canExecute        = canExecute;
            this.execute           = execute;
        }