예제 #1
0
 protected override void OnViewAttached(object view, object context)
 {
     base.OnViewAttached(view, context);
     _view = view as LoginDialogView;
     Debug.Assert(_view != null);
     _view.password.Password = Password;
 }
        protected override void OnViewAttached(object view, object context)
        {
            base.OnViewAttached(view, context);
            _view = view as LoginDialogView;
            Debug.Assert(_view != null);
            _view.password.Password = Password;

        }
예제 #3
0
        public void Constructor_Initializes()
        {
            var vm = new LoginDialogViewModel(services);

            vm.Target = "http://test/";
            var view = new LoginDialogView(vm);

            // Verify DataContext initalized
            Assert.AreSame(vm, view.DataContext);

            // Verify Login command points to view model
            var command = view.LoginCommand as AsyncDelegatingCommand;

            Assert.IsNotNull(command);
            Assert.AreEqual(vm, command.action.Target);

            // Verify ViewModel callback for password
            Assert.IsNotNull(vm.GetPassword);

            // Verify binding to Target to tbUrl
            Assert.AreEqual(vm.Target, view.tbUrl.Text);
        }