public override void Closed() { base.Closed(); PhidgetLEDBoard board = Interface as PhidgetLEDBoard; if (board != null) { foreach (LEDGroup group in board.LedGroups) { board.SetGroupPower(group, false); } board.Detach(); } }
protected override void OnInterfaceChanged(HeliosInterface oldInterface, HeliosInterface newInterface) { PhidgetLEDBoard oldBoard = oldInterface as PhidgetLEDBoard; if (oldBoard != null) { oldBoard.Detach(); } PhidgetLEDBoard newBoard = newInterface as PhidgetLEDBoard; if (newBoard != null) { newBoard.Attach(); } GroupsViewModel = new LedGroupsViewModel(newInterface as PhidgetLEDBoard); }