private void InsertNewColumn(object sender, RoutedEventArgs e) { KanbanColumnOptions column = new KanbanColumnOptions(true, "New Column", null); column.Background = new SolidColorBrush(Color.FromArgb(255, 230, 255, 230)); columnList.Children.Insert(columnList.Children.Count - 1, column); scrollViewer.ScrollToBottom(); }
public CreateProjectDialog(ProjectList projects, ProjectData project) { Projects = projects; Project = project; InitializeComponent(); if (Project != null) { StatusModel.FillProject(Project); headerLabel.Content = "Edit Project " + Project.Key; deleteButton.IsEnabled = true; nameInput.Text = Project.Name; keyInput.Text = Project.Key; KanbanColumnOptions releaseColumn = null; List <StatusData> statuses = Project.GetAllStatuses(); foreach (StatusData status in statuses) { bool editable = !status.IsBacklog; string title = status.Title; string description = null; if (status.IsBacklog) { description = BacklogDescription; } else if (statuses.IndexOf(status) == 1) { description = PlannedDescription; } else if (status.IsRelease) { description = ReleaseDescription; } KanbanColumnOptions columnOptions = new KanbanColumnOptions(editable, title, description) { ID = status.ID }; columnOptions.SetMinCards(status.MinCards); columnOptions.SetMaxCards(status.MaxCards); if (status.IsRelease) { releaseColumn = columnOptions; } else { columnList.Children.Add(columnOptions); } } columnList.Children.Add(releaseColumn); } else { columnList.Children.Add(new KanbanColumnOptions(false, "Backlog", BacklogDescription)); columnList.Children.Add(new KanbanColumnOptions(true, "Planned", PlannedDescription)); columnList.Children.Add(new KanbanColumnOptions(true, "Done", ReleaseDescription)); } ImageBrush logoBrush = new ImageBrush(WazeraUtils.GetResource("default_project.png")); logoPreview.Fill = logoBrush; logoPreviewSmall.Fill = logoBrush; AddCategories(); nameInput.TextChanged += (sender, e) => GenerateKey(); keyInput.TextChanged += (sender, e) => FormatKey(); saveButton.Click += (sender, e) => SaveButtonClick(); }