Esempio n. 1
0
        public ExpandDockItem(ExpandDockItemData data, UIElement itemParent)
        {
            self       = data;
            itemparent = itemParent;
            HeaderItem button = new HeaderItem();

            button.HeaderType = data.Type;
            button.Click     += new RoutedEventHandler(button_Click);
            button.Content    = data.Name;
            button.SetValue(DockPanel.DockProperty, Dock.Top);
            this.Children.Add(button);
            stackPanel             = new StackPanel();
            stackPanel.Orientation = Orientation.Vertical;
            if (data.Children.Count > 0)
            {
                foreach (ExpandDockItemData kv in data.Children)
                {
                    ExpandDockItem item = new ExpandDockItem(kv, this);
                    kv.UI = item;
                    item.SetValue(DockProperty, Dock.Top);
                    stackPanel.Children.Add(item);
                }
                stackPanel.Height = 0;
            }
            this.Children.Add(stackPanel);
        }
Esempio n. 2
0
        public string tostring()
        {
            ExpandDockItemData data     = this;
            List <string>      nameList = new List <string>();

            nameList.Add(data.Name);
            while (data.Parent != null)
            {
                data = data.Parent;
                nameList.Add(data.Name);
            }
            string str = "";

            for (int index = nameList.Count - 1; index >= 0; index--)
            {
                str += nameList[index] + ",";
            }
            str = str.Substring(0, str.Length - 1);
            return(str);
        }
Esempio n. 3
0
 public void AddChild(ExpandDockItemData data)
 {
     child.Add(data);
     data.Parent = this;
 }
Esempio n. 4
0
        public ExpandDockItem(ExpandDockItemData data, UIElement itemParent)
        {
            self = data;
            itemparent = itemParent;
            HeaderItem button = new HeaderItem();
            button.HeaderType = data.Type;
            button.Click += new RoutedEventHandler(button_Click);
            button.Content = data.Name;
            button.SetValue(DockPanel.DockProperty, Dock.Top);
            this.Children.Add(button);
            stackPanel = new StackPanel();
            stackPanel.Orientation = Orientation.Vertical;
            if (data.Children.Count > 0)
            {
                foreach (ExpandDockItemData kv in data.Children)
                {
                    ExpandDockItem item = new ExpandDockItem(kv, this);
                    kv.UI = item;
                    item.SetValue(DockProperty, Dock.Top);
                    stackPanel.Children.Add(item);
                }
                stackPanel.Height = 0;
            }
            this.Children.Add(stackPanel);

        }
Esempio n. 5
0
 public void AddChild(ExpandDockItemData data)
 {
     child.Add(data);
     data.Parent = this;
 }