// Control area commands.
        private void SetColorButton_Click(object sender, RoutedEventArgs e)
        {
            PertChartItem item = PertChartView.Items[2];

            DlhSoft.Windows.Controls.Pert.PertChartView.SetShapeFill(item, Resources["CustomShapeFill"] as Brush);
            DlhSoft.Windows.Controls.Pert.PertChartView.SetShapeStroke(item, Resources["CustomShapeStroke"] as Brush);
            DlhSoft.Windows.Controls.Pert.PertChartView.SetTextForeground(item, Resources["CustomShapeStroke"] as Brush);
        }
        public MainWindow()
        {
            InitializeComponent();

            PertChartItem item0 = PertChartView.Items[0];

            PertChartItem item1 = PertChartView.Items[1];

            item1.Predecessors.Add(new PredecessorItem {
                Item = item0, DisplayedText = "A", Content = "Task A", Effort = TimeSpan.Parse("4")
            });

            PertChartItem item2 = PertChartView.Items[2];

            item2.Predecessors.Add(new PredecessorItem {
                Item = item0, DisplayedText = "B", Content = "Task B", Effort = TimeSpan.Parse("2")
            });

            PertChartItem item3 = PertChartView.Items[3];

            item3.Predecessors.Add(new PredecessorItem {
                Item = item2, DisplayedText = "C", Content = "Task C", Effort = TimeSpan.Parse("1")
            });

            PertChartItem item4 = PertChartView.Items[4];

            item4.Predecessors.Add(new PredecessorItem {
                Item = item1, DisplayedText = "D", Content = "Task D", Effort = TimeSpan.Parse("5")
            });
            item4.Predecessors.Add(new PredecessorItem {
                Item = item2, DisplayedText = "E", Content = "Task E", Effort = TimeSpan.Parse("3")
            });
            item4.Predecessors.Add(new PredecessorItem {
                Item = item3, DisplayedText = "F", Content = "Task F", Effort = TimeSpan.Parse("2")
            });
        }
 private void SetCriticalPathHighlighting(PertChartItem item, bool isHighlighted)
 {
     DlhSoft.Windows.Controls.Pert.PertChartView.SetShapeFill(item, isHighlighted ? Resources["CustomShapeFill"] as Brush : PertChartView.ShapeFill);
     DlhSoft.Windows.Controls.Pert.PertChartView.SetShapeStroke(item, isHighlighted ? Resources["CustomShapeStroke"] as Brush : PertChartView.ShapeStroke);
     DlhSoft.Windows.Controls.Pert.PertChartView.SetTextForeground(item, isHighlighted ? Resources["CustomShapeStroke"] as Brush : PertChartView.TextForeground);
 }