Catel.Test.MVVM.CompositeCommandFacts.TheAutoUnsubscribeFunctionality.AutomaticallyUnsubscribesCommandOnViewModelClosed C# (CSharp) Метод

AutomaticallyUnsubscribesCommandOnViewModelClosed() приватный Метод

private AutomaticallyUnsubscribesCommandOnViewModelClosed ( ) : System.Threading.Tasks.Task
Результат System.Threading.Tasks.Task
            public async Task AutomaticallyUnsubscribesCommandOnViewModelClosed()
            {
                var vm = new CompositeCommandViewModel();
                var compositeCommand = new CompositeCommand();

                compositeCommand.RegisterCommand(vm.TestCommand1, vm);

                Assert.IsFalse(vm.IsTestCommand1Executed);

                await vm.CloseViewModelAsync(false);

                compositeCommand.Execute();

                Assert.IsFalse(vm.IsTestCommand1Executed);
            }
        }
CompositeCommandFacts.TheAutoUnsubscribeFunctionality