Пример #1
0
        public void DelegateCommandTestToggleCanExecute()
        {
            bool canExecute           = true;
            bool executeChangedCalled = false;

            var command = new DelegateCommand(() =>
            {
            }, () =>
            {
                return(canExecute);
            });

            command.CanExecuteChanged += (s, e) =>
            {
                executeChangedCalled = true;
            };

            command.CheckCanExecute();

            Assert.IsTrue(executeChangedCalled);
        }