This class is the control that is displayed for nodes that have children.
Inheritance: GanttItem
Ejemplo n.º 1
0
        private void GenerateItems()
        {
            if (Node == null)
            {
                ItemsPresenter.Children.Clear();
            }
            else if (!ItemsValid)
            {
                ItemsValid = true;
                ItemsPresenter.Children.Clear();

                GanttItem item = null;


                if (Node.Sections.Count == 1)
                {
                    if (Node.ChildNodes.Count == 0)
                    {
                        item = new GanttItem();
                    }
                    else
                    {
                        item = new HeaderGanttItem();
                    }

                    item.GapBackgroundBrush     = this.GapBackgroundBrush;
                    item.GapBorderBrush         = this.GapBorderBrush;
                    item.ToolTipContent         = this.Node;
                    item.ToolTipContentTemplate = this.ParentPanel.ToolTipContentTemplate;
                    item.Section   = Node.Sections[0];
                    item.ParentRow = this;
                    item.Node      = Node;
                    ItemsPresenter.Children.Add(item);
                }
                else
                {
                    foreach (GanttNodeSection section in Node.Sections)
                    {
                        item = new GanttItem();

                        if (section.BackgroundBrush != null)
                        {
                            item.Background = section.BackgroundBrush;
                        }

                        item.ToolTipContent         = this.Node;
                        item.ToolTipContentTemplate = this.ParentPanel.ToolTipContentTemplate;
                        item.ParentRow = this;
                        item.Node      = Node;
                        item.Section   = section;
                        ItemsPresenter.Children.Add(item);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void GenerateItems()
        {
            if (Node == null)
            {
                ItemsPresenter.Children.Clear();
            }
            else if (!ItemsValid)
            {
                ItemsValid = true;
                ItemsPresenter.Children.Clear();

                GanttItem item = null;

                if (Node.Sections.Count == 1)
                {
                    if (Node.ChildNodes.Count == 0)
                        item = new GanttItem();
                    else
                        item = new HeaderGanttItem();

                    item.GapBackgroundBrush = this.GapBackgroundBrush;
                    item.GapBorderBrush = this.GapBorderBrush;
                    item.ToolTipContent = this.Node;
                    item.ToolTipContentTemplate = this.ParentPanel.ToolTipContentTemplate;
                    item.Section = Node.Sections[0];
                    item.ParentRow = this;
                    item.Node = Node;
                    ItemsPresenter.Children.Add(item);
                }
                else
                {
                    foreach (GanttNodeSection section in Node.Sections)
                    {
                        item = new GanttItem();

                        if(section.BackgroundBrush != null)
                            item.Background = section.BackgroundBrush;

                        item.ToolTipContent = this.Node;
                        item.ToolTipContentTemplate = this.ParentPanel.ToolTipContentTemplate;
                        item.ParentRow = this;
                        item.Node = Node;
                        item.Section = section;
                        ItemsPresenter.Children.Add(item);
                    }
                }
            }
        }