Пример #1
0
        public static VisualTreeItem Construct(object target, VisualTreeItem parent)
        {
            VisualTreeItem visualTreeItem;

            if (target is Visual)
            {
                visualTreeItem = new VisualItem((Visual)target, parent);
            }
            else if (target is ResourceDictionary)
            {
                visualTreeItem = new ResourceDictionaryItem((ResourceDictionary)target, parent);
            }
            else if (target is Application)
            {
                visualTreeItem = new ApplicationTreeItem((Application)target, parent);
            }
            else
            {
                visualTreeItem = new VisualTreeItem(target, parent);
            }

            visualTreeItem.Reload();

            return(visualTreeItem);
        }
Пример #2
0
 protected VisualTreeItem(object target, VisualTreeItem parent)
 {
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     Target  = target;
     _parent = parent;
     if (parent != null)
     {
         _depth = parent._depth + 1;
     }
 }
Пример #3
0
 protected VisualTreeItem(object target, VisualTreeItem parent)
 {
     if (target == null)
     {
         throw new ArgumentNullException(nameof(target));
     }
     Target = target;
     Parent = parent;
     if (parent != null)
     {
         Depth = parent.Depth + 1;
     }
 }
Пример #4
0
 public ApplicationTreeItem(Application application, VisualTreeItem parent)
     : base(application, parent)
 {
     _application = application;
 }
Пример #5
0
 protected void RemoveChild(VisualTreeItem item)
 {
     item.IsSelected = false;
     Children.Remove(item);
 }
Пример #6
0
 public VisualItem(Visual visual, VisualTreeItem parent)
     : base(visual, parent)
 {
     Visual = visual;
 }
Пример #7
0
 public ResourceContainerItem(object target, VisualTreeItem parent) : base(target, parent)
 {
 }
Пример #8
0
 public ResourceItem(object target, object key, VisualTreeItem parent) : base(target, parent)
 {
     _key = key;
 }
Пример #9
0
 public ResourceDictionaryItem(ResourceDictionary dictionary, VisualTreeItem parent) : base(dictionary, parent)
 {
     _dictionary = dictionary;
 }
Пример #10
0
 public FormsTreeItem(Control control, VisualTreeItem parent)
     : base(control, parent)
 {
     Control = control;
 }