private void OnConnectionsInsertAtEventHandler(int indexAt, Connection connection) { if (_connections.All(c => c.Id != connection.Id)) { _connections.Insert(indexAt, new ConnectionViewModel(connection, _client, _inspectorTool)); } NotifyOfPropertyChange(() => ConnectionCount); }
private void AddNotExistingToChildren(BindableCollection <KeyValueUnitViewModel> viewModels, IReadOnlyCollection <Tag> newTags) { foreach (Tag newTag in newTags) { if (viewModels.All(c => !string.Equals(c.Name, newTag.Name))) { viewModels.Add(new KeyValueUnitViewModel(this, newTag)); } } }