protected override void OnMouseLeave(System.Windows.Input.MouseEventArgs e) { base.OnMouseLeave(e); if (ParentPanel.IsReadOnly) return; Predecessor = null; ParentPanel.DependencyPresenter.DependencyLinker.Visibility = System.Windows.Visibility.Collapsed; ParentPanel.DependencyPresenter.IsHitTestVisible = true; }
protected override void OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs e) { base.OnMouseLeftButtonUp(e); if (ParentPanel.IsReadOnly) return; foreach (var row in Children.OfType<GanttRow>()) foreach (GanttItem item in row.ItemsPresenter.Children.OfType<GanttItem>()) item.DragState = DragState.None; Predecessor = null; ParentPanel.DependencyPresenter.DependencyLinker.Visibility = System.Windows.Visibility.Collapsed; ParentPanel.DependencyPresenter.IsHitTestVisible = true; ReleaseMouseCapture(); }
private void GenerateItems() { if (Node == null) { ItemsPresenter.Children.Clear(); } else if (!ItemsValid) { ItemsValid = true; ItemsPresenter.Children.Clear(); //GanttItem item = null; if (Node.HasChild) { var item = new HeaderGanttItem(); item.Node = Node.Items.FirstOrDefault(); item.ItemContent = item.Node; item.ToolTipContentTemplate = this.ParentPanel.ParentGanttChart.ToolTipContentTemplate; item.ItemLeftTemplate = this.ParentPanel.ParentGanttChart.ItemLeftTemplate; item.ItemRightTemplate = this.ParentPanel.ParentGanttChart.ItemRightTemplate; item.ItemContentTemplate = this.ParentPanel.ParentGanttChart.ItemContentTemplate; item.ParentRow = this; //ItemsPresenter.ItemShadow.StartDate = Node.StartDate; //ItemsPresenter.ItemShadow.EndDate = Node.EndDate; ItemsPresenter.Children.Add(item); } else { foreach (var i in Node.Items) { var item = new GanttItem(); item.ItemContent = i; item.ToolTipContentTemplate = this.ParentPanel.ParentGanttChart.ToolTipContentTemplate; item.ItemLeftTemplate = this.ParentPanel.ParentGanttChart.ItemLeftTemplate; item.ItemRightTemplate = this.ParentPanel.ParentGanttChart.ItemRightTemplate; item.ItemContentTemplate = this.ParentPanel.ParentGanttChart.ItemContentTemplate; //item.ItemBottomTemplate = this.ParentPanel.ParentGanttChart.ItemBottomTemplate; item.ParentRow = this; item.Node = i; //ItemsPresenter.ItemShadow.StartDate = Node.StartDate; //ItemsPresenter.ItemShadow.EndDate = Node.EndDate; ItemsPresenter.Children.Add(item); i.Successors.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(Successors_CollectionChanged); //if (Node.ActualStartDate.HasValue && Node.ActualEndDate.HasValue) //{ // var actualItem = new GanttActualItem(); // actualItem.ParentRow = this; // actualItem.ItemContent = Node; // actualItem.ToolTipContentTemplate = this.ParentPanel.ParentGanttChart.ToolTipContentTemplate; // actualItem.Node = Node; // //actualItem.IsFinished = Node.PercentComplete == 100; // actualItem.Visibility = IsShowActualItem ? Visibility.Visible : Visibility.Hidden; // ItemsPresenter.Children.Add(actualItem); //} } } ItemsPresenter.Children.Add(ItemsPresenter.ItemShadow); } }
public GanttItemEventArgs(GanttItem item) { Item = item; }
private void UpdateDependencies(GanttItem ganttItem) { var deps = Dependencies.Where(d => d.Successor == ganttItem.Node || d.Predecessor == ganttItem.Node); var items = DependencyPresenter.Children.OfType<GanttDependencyItem>() .Where(d => d.Dependency.Successor == ganttItem.Node || d.Dependency.Predecessor == ganttItem.Node); foreach (var d in items) d.UpdateDependencyLines(); }