Пример #1
0
        public void NotifyCanExecuteChanged_FiresCanExecuteChangedEvent()
        {
            MockCommandHandler<MockArgumentClass> handler = new MockCommandHandler<MockArgumentClass>();
            DelegateCommand<MockArgumentClass> command = new DelegateCommand<MockArgumentClass>(handler.Execute, handler.CanExecute);

            int canExecuteChangedCount = 0;
            command.CanExecuteChanged += (sender, e) =>
                {
                    canExecuteChangedCount++;
                };

            command.NotifyCanExecuteChanged();

            Assert.AreEqual(1, canExecuteChangedCount);
        }