protected override void OnViewAttached(object view, object context) { base.OnViewAttached(view, context); _view = view as LoginDialogView; Debug.Assert(_view != null); _view.password.Password = Password; }
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); }