public IViewAdaper <ConnectionInfoView, ViewResult> GetConnectionInfoView(IProjectManager projectManager, IProjectConfigurationManager configurationManager) { var viewModel = new ConnectionInfoViewModel(authManager, this, configurationManager, projectManager); var view = new ConnectionInfoView(); view.DataContext = viewModel; AttachToParentWindow(view); return(new ConnectionInfoViewAdapter(view)); }
private void ShowConnectionInfoView() { if (connectionInfoView == null) { connectionInfoView = new ConnectionInfoView(new ConnectionInfoViewModel(serviceManager)); connectionInfoView.Closing += (sender, e) => connectionInfoView = null; connectionInfoView.Show(); } else { connectionInfoView.Activate(); } }
public void ExecuteCommandImpl_ShouldReceivedGetConnectionInfoView() { // Arrange var view = new ConnectionInfoView(); var adapter = Substitute.For <ConnectionInfoViewAdapter>(view); dialogFactory.GetConnectionInfoView(projectManager, projectConfigurationManager).Returns(adapter); //Act ÑonnectionInfoCmd.ExecuteCommandImpl(null, null); // Assert dialogFactory.Received().GetConnectionInfoView(projectManager, projectConfigurationManager); }
public IViewAdaper <ConnectionInfoView, ViewResult> GetConnectionInfoView(IProjectManager projectManager, IProjectConfigurationManager configurationManager) { var projectConfiguration = configurationManager.Load(projectManager.ProjectConfigPath); var viewModel = new ConnectionInfoViewModel(authManager, this, configurationManager, projectManager, projectConfiguration); var view = new ConnectionInfoView(); view.DataContext = viewModel; IntPtr hwnd; projectManager.UIShell.GetDialogOwnerHwnd(out hwnd); var windowInteropHelper = new WindowInteropHelper(view); windowInteropHelper.Owner = hwnd; return(new ConnectionInfoViewAdapter(view)); }