public Node(string name, bool isExpanded, BitmapImage icon, IObservableCollection <ResourceViewModel> resources = null, IObservableCollection <Node> children = null) { _name = name; _isExpanded = isExpanded; _icon = icon; Nodes = children ?? new ObservableCollection <Node>(); if (resources != null) { Resources = resources; Resources.PropertyChanged += ResourcesOnPropertyChanged; _propChangedName = new ActionDeferrer(() => Notify("Name"), TimeSpan.FromSeconds(0.5), Dispatcher.CurrentDispatcher); } }
public void Dispose() { _propChangedName = null; Nodes.PropertyChanged -= ResourcesOnPropertyChanged; }