private void DeviceRemoved(object sender, DeviceChangeEventArgs e) { if ((e.Type == INTV.Core.Model.Device.ConnectionType.Serial) && DeviceChange.IsDeviceChangeFromSystem(e.State)) { var removedDevice = SerialPorts.FirstOrDefault(p => p.PortName == e.Name); if ((removedDevice != null) && SerialPorts.Remove(removedDevice)) { INTV.Shared.ComponentModel.CommandManager.InvalidateRequerySuggested(); } } RaisePropertyChanged("IsPortValid"); }