/// <summary> /// Attach various viewmodels together /// </summary> /// <param name="connectionControlViewManager"></param> /// <param name="serialTesterViewModel"></param> /// <param name="loggingControlViewModel"></param> public void CompleteWiring( ConnectionControlViewManager connectionControlViewManager, SerialTesterViewModel serialTesterViewModel, LoggingControlViewModel loggingControlViewModel, DemoControlViewModel demoControlViewModel) { connectionControlViewManager.Messager = loggingControlViewModel; serialTesterViewModel.Messager = loggingControlViewModel; demoControlViewModel.Messager = loggingControlViewModel; demoControlViewModel.EnableLoggingAction = b => loggingControlViewModel.IsLoggingEnabled = b; this.connectionControlViewManager = connectionControlViewManager; this.serialTesterViewModel = serialTesterViewModel; this.loggingControlViewModel = loggingControlViewModel; this.demoControlViewModel = demoControlViewModel; connectionControlViewManager.PropertyChanged += ConnectionControlViewManagerOnPropertyChanged; SetDevices(connectionControlViewManager); }
/// <summary> /// Set new devices if main one changed /// </summary> /// <param name="connectionViewManager"></param> void SetDevices(ConnectionControlViewManager connectionViewManager) { Device = connectionViewManager.Device; serialTesterViewModel.Device = Device as HypnoLsdController; demoControlViewModel.Device = Device as HypnoLsdController; }