public class TaskDetails
{
public TaskDetails()
{
Tasks = new ObservableCollection<KanbanModel>();
KanbanModel task = new KanbanModel();
task.Title = "test";
task.ID = "1";
task.Description = "Project Name -";
task.Category = "Project";
task.ColorKey = "High";
task.Tags = new string[] { "BO2", "MP" };
Tasks.Add(task);
}
public ObservableCollection<KanbanModel> Tasks { get; set; }
public void CreateTask(string title, string id, string desc, string category, string color, string[] tags)
{
KanbanModel task = new KanbanModel();
task.Title = title;
task.ID = id;
task.Description = desc;
task.Category = category;
task.ColorKey = color;
task.Tags = tags;
Tasks.Add(task);
}
}
|
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void CreateprojectButton_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("test");
taskDetails.CreateTask("test1", "3", "Description", "Project", "High", new string[] { "BO2", "MP" });
}
}
|