예제 #1
0
 public MainViewModel()
 {
     this.SimpleViewModel = new BasicViewModel();
     this.StylesViewModel = new StylesDemoViewModel();
     this.CallViewModel = new OptionViewModel<CallOption>();
     this.PutViewModel = new OptionViewModel<PutOption>();
     this.AsyncViewModel = new AsyncViewModel();
 }
예제 #2
0
        public async Task IncorrectDelegateCommand()
        {
            var vm = new AsyncViewModel();

            await vm.AsyncCommand.Execute();

            Assert.AreEqual(vm.Status, "Downloaded 5 houses.");
        }
예제 #3
0
        public async Task AsyncFromDelegateCommand()
        {
            var vm = new AsyncViewModel();

            await vm.AsyncCommandFromHandler.Execute();

            Assert.AreEqual(vm.Status, "Downloaded 5 houses.");
        }
예제 #4
0
        public async void TestMethod()
        {
            var vm = new AsyncViewModel();

            await vm.AsyncCommandFromHandler.Execute();

            Assert.AreEqual(vm.Status, "Alex");
        }
예제 #5
0
        public async void Blah2()
        {
            var egg = new AsyncViewModel();
            await egg.AsyncCommand.Execute();

            string result = egg.Status;

            Debug.Print(result);
        }
예제 #6
0
        public async Task AsyncCommandOwn()
        {
            var vm = new AsyncViewModel();

            var a = new AsyncCommand(null);

            Task executeCommand = vm.AsyncCommandOwn.ExecuteAsync();

            Assert.IsFalse(vm.AsyncCommandOwn.CanExecute());

            await executeCommand;

            Assert.IsTrue(vm.AsyncCommandOwn.CanExecute());
            Assert.AreEqual(vm.Status, "Downloaded 5 houses.");
        }