示例#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;
     }
 }
 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)
 {
 }
 public ResourceItem(object target, object key, VisualTreeItem parent) : base(target, parent)
 {
     _key = key;
 }
 public ResourceDictionaryItem(ResourceDictionary dictionary, VisualTreeItem parent) : base(dictionary, parent)
 {
     _dictionary = dictionary;
 }
示例#10
0
 public FormsTreeItem(Control control, VisualTreeItem parent)
     : base(control, parent)
 {
     Control = control;
 }