/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel() { instance = this; // this sets the static Instance property to this instance. Plugins = new ObservableCollection<PluginBase>(); Devices = new ObservableCollection<Device>(); Motors = new ObservableCollection<MotorViewModel>(); Plugins.CollectionChanged += Plugins_CollectionChanged; Controllers = new ObservableCollection<ControllerViewModel>(); Controllers.CollectionChanged += Controllers_CollectionChanged; Robot = new Robot(); // This lets us know what's going on with the Robot's internal Joint collection. Robot.Controllers.CollectionChanged += RobotControllers_CollectionChanged; //InputSignalRegistry = new ViewModel.SignalSinkRegistryViewModel(); InputSignalRegistry = new ObservableDictionary<string, string>(); Messenger.Default.Register<Messages.RemoveController>(this, (message) => { Controllers.Remove(message.ControllerToRemove); com = this.Robot.Com; } ); }