Пример #1
0
        private void OnRemoved(TModel element)
        {
            element.ChangedRebuild -= OnAdded;
            element.ChangedRebuild -= OnRemoved;
            element.Changed        -= OnChanged;

            foreach (var representation in _modelToView[element])
            {
                _view.Remove(representation);
                _viewToModel.Remove(representation);

                var disposable = representation as IDisposable;
                disposable?.Dispose();
            }
            _modelToView.RemoveKey(element);
        }