public void ClearGantt()
 {
     ganttChartData.RowGroups.Clear();
     ganttChartData.TimeLines.Clear();
     GridLineTimeLine.Clear();
     SelectedItems.Clear();
     // This is to fix the resizing issue when the background timelines don't resize to fit the scrollviewer.
     Dispatcher.Invoke(DispatcherPriority.Render, EmptyDelegate);
 }
Ejemplo n.º 2
0
        public void SetGridLinesTimeline(TimeLine timeline, BackgroundFormatter backgroundFormatter)
        {
            if (!ganttChartData.TimeLines.Contains(timeline))
            {
                throw new Exception("Invalid timeline");
            }

            foreach (var item in timeline.Items)
            {
                item.BackgroundColor = backgroundFormatter(item);
            }

            GridLineTimeLine.Clear();
            GridLineTimeLine.Add(timeline);
        }