I'm trying to bind to a custom control like so:
<my:GanttChartTaskListView Name="ganttChartTaskListView1" ItemsSource="{Binding Source={x:Static local:TaskCollection.taskList}}" />
In my WPF Window constructor I add add an item to my taskList, when it loads I can see that item in my custom control, however, when I subsequently add items it does not update. I tried setting Mode=TwoWay, however, then it says the "Path" is required and I'm not familiar with binding like that (this is new to me).
Here is my TaskCollection class:
namespace ProjectManager
{
public static class TaskCollection
{
private static List<TaskItem> _taskList = new List<TaskItem>();
public static List<TaskItem> taskList
{
get {return _taskList; }
set { _taskList = value; }
}
}
}
Any ideas? Is there a better / easier way to do this?