public void ConnectMachine(string mchineId) { if (this.controllerWindow == null) { Application.Current.Dispatcher.Invoke(() => { this.controllerWindow = new ControllerWindowView(); this.controllerWindow.Closed += ControllerWindow_Closed; this.controllerWindow.Show(); }); } this.controllerWindow.ConnectMachine(mchineId); }
private void ControllerWindow_Closed(object sender, EventArgs e) { this.controllerWindow = null; }