Example #1
0
 protected void OnSelectionChanged(AppTreeNode sender)
 {
     if (SelectionChanged != null)
     {
         SelectionChanged(sender);
     }
 }
        private void UpdatePreview()
        {
            if (_previewChild != null)
            {
                _previewChild.PropertyChanged -= PreviewPropertyChanged;
            }

            if (_children.Count == 0)
            {
                Icon = null;
                OnPropertyChanged("Icon");

                return;
            }

            _previewChild = _children.First();
            _previewChild.PropertyChanged += PreviewPropertyChanged;

            if (IsSelected)
            {
                Icon = null;
                OnPropertyChanged("Icon");
            }
            else
            {
                Icon = _previewChild.Icon;
                OnPropertyChanged("Icon");
            }
        }
Example #3
0
        public void AddChild(AppTreeNode item)
        {
            item.SelectionChanged += OnSelectionChanged;
            item.Parent = this;
            _children.Add(item);

            if (_enablePreview) UpdatePreview();
        }
        public void AddChild(AppTreeNode item)
        {
            item.SelectionChanged += OnSelectionChanged;
            item.Parent            = this;
            _children.Add(item);

            if (_enablePreview)
            {
                UpdatePreview();
            }
        }
        public bool RemoveChild(AppTreeNode item)
        {
            item.SelectionChanged -= OnSelectionChanged;
            item.Parent            = null;
            var result = _children.Remove(item);

            if (_enablePreview)
            {
                UpdatePreview();
            }
            return(result);
        }
Example #6
0
 protected void OnSelectionChanged(AppTreeNode sender)
 {
     if (SelectionChanged != null)
     {
         SelectionChanged(sender);
     }
 }
Example #7
0
        public bool RemoveChild(AppTreeNode item)
        {
            item.SelectionChanged -= OnSelectionChanged;
            item.Parent = null;
            var result = _children.Remove(item);

            if (_enablePreview) UpdatePreview();
            return result;
        }
Example #8
0
        private void UpdatePreview()
        {
            if (_previewChild != null) _previewChild.PropertyChanged -= PreviewPropertyChanged;

            if(_children.Count == 0)
            {
                Icon = null;
                OnPropertyChanged("Icon");

                return;
            }

            _previewChild = _children.First();
            _previewChild.PropertyChanged += PreviewPropertyChanged;

            if (IsSelected)
            {
                Icon = null;
                OnPropertyChanged("Icon");
            }
            else
            {
                Icon = _previewChild.Icon;
                OnPropertyChanged("Icon");
            }
        }