void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.TaskCard = ((SprintBoard.TaskControl)(target)); return; case 2: this.TaskDetailsRow = ((System.Windows.Controls.RowDefinition)(target)); return; case 3: this.AvatarButton = ((System.Windows.Controls.Button)(target)); #line 59 "..\..\TaskControl.xaml" this.AvatarButton.Click += new System.Windows.RoutedEventHandler(this.ChangeUserClick); #line default #line hidden return; case 4: this.Scroller = ((System.Windows.Controls.ScrollViewer)(target)); return; case 5: this.Mediator = ((SprintBoard.ScrollViewerOffsetMediator)(target)); return; case 6: #line 90 "..\..\TaskControl.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.LeftDecrementClick); #line default #line hidden return; case 7: #line 94 "..\..\TaskControl.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.LeftIncrementClick); #line default #line hidden return; case 8: #line 103 "..\..\TaskControl.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.TakenIncrementClick); #line default #line hidden return; case 9: this.users = ((System.Windows.Controls.Border)(target)); return; } this._contentLoaded = true; }
private void CreateColumnTasks(List<StoryTask> storyTasks, Column column) { foreach (var key in storyYPositions.Keys) { xPos = SetXStartPos(column); yPos = storyYPositions[key]; var cardCount = 0; var stackCount = 0; var currentstoryTasks = storyTasks.Where(t => t.StoryNumber == key).ToList(); var maxCard = 10; if (column == Column.Testing) { maxCard = 5; } if (currentstoryTasks.Count >= maxCard) { currentstoryTasks = currentstoryTasks.Take(maxCard).ToList(); if (column == Column.Testing) { testingFull = true; } } currentstoryTasks = currentstoryTasks.OrderByDescending(st => st.Number).ToList(); foreach (var storyTask in currentstoryTasks) { var taskControl = new TaskControl(); var tcvm = new TaskCardViewModel { Users = sbvm.Users, StoryTask = storyTask }; if (testingFull) taskControl.BackgroundColour = Brushes.OrangeRed; else taskControl.BackgroundColour = Brushes.White; taskControl.DataContext = tcvm; taskControl.SetValue(Canvas.LeftProperty, xPos); taskControl.SetValue(Canvas.TopProperty, yPos); taskControl.MouseDown += ControlMouseDown; taskControl.MouseMove += ControlMouseMove; taskControl.MouseUp += ControlMouseUp; cardCount++; if (cardCount < 5) { SetXYForColumn(column); } else { stackCount++; xPos = SetXStartPos(column) + (CARD_WIDTH * stackCount) + 5; yPos = storyYPositions[key]; cardCount = 0; } SprintBoard.Children.Add(taskControl); } testingFull = false; } }
private void CreateColumnTasks(List <StoryTask> storyTasks, Column column) { foreach (var key in storyYPositions.Keys) { xPos = SetXStartPos(column); yPos = storyYPositions[key]; var cardCount = 0; var stackCount = 0; var currentstoryTasks = storyTasks.Where(t => t.StoryNumber == key).ToList(); var maxCard = 10; if (column == Column.Testing) { maxCard = 5; } if (currentstoryTasks.Count >= maxCard) { currentstoryTasks = currentstoryTasks.Take(maxCard).ToList(); if (column == Column.Testing) { testingFull = true; } } currentstoryTasks = currentstoryTasks.OrderByDescending(st => st.Number).ToList(); foreach (var storyTask in currentstoryTasks) { var taskControl = new TaskControl(); var tcvm = new TaskCardViewModel { Users = sbvm.Users, StoryTask = storyTask }; if (testingFull) { taskControl.BackgroundColour = Brushes.OrangeRed; } else { taskControl.BackgroundColour = Brushes.White; } taskControl.DataContext = tcvm; taskControl.SetValue(Canvas.LeftProperty, xPos); taskControl.SetValue(Canvas.TopProperty, yPos); taskControl.MouseDown += ControlMouseDown; taskControl.MouseMove += ControlMouseMove; taskControl.MouseUp += ControlMouseUp; cardCount++; if (cardCount < 5) { SetXYForColumn(column); } else { stackCount++; xPos = SetXStartPos(column) + (CARD_WIDTH * stackCount) + 5; yPos = storyYPositions[key]; cardCount = 0; } SprintBoard.Children.Add(taskControl); } testingFull = false; } }