Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
 public void Dispose()
 {
     _propChangedName       = null;
     Nodes.PropertyChanged -= ResourcesOnPropertyChanged;
 }