private PileControl AddNewPileControl(Workspace.Pile inPile) { PileControl pile_control = new PileControl(this, inPile); pile_control.VerticalAlignment = VerticalAlignment.Top; pile_control.OnDragTaskControlStarted += Pile_OnDragTaskStarted; pile_control.OnDragTaskControlMoved += Pile_OnDragTaskMoved; pile_control.OnDragTaskControlStopped += Pile_OnDragTaskStopped; pile_control.OnDragPileControlStarted += Pile_OnDragPileStarted; pile_control.OnDragPileControlMoved += Pile_OnDragPileMoved; pile_control.OnDragPileControlStopped += Pile_OnDragPileStopped; stackPanel.Children.Insert(stackPanel.Children.Count - 1, pile_control); return(pile_control); }
public PileControl(MainWindow inParentWindow, Workspace.Pile inPile) { InitializeComponent(); mPile = inPile; ParentWindow = inParentWindow; if (inPile.Title != null) { Workspace.SetFlowDocumentContentFromXML(titleTextBox.Document, inPile.Title); } headerGrid.Background = new SolidColorBrush(inPile.Color); foreach (Workspace.Task task in inPile.Tasks) { AddNewTaskControl(task); } }
private void AddPileRect_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { Workspace.Pile new_pile = new Workspace.Pile(); Workspace.Instance.AddPile(new_pile); AddNewPileControl(new_pile); }