public Root(TaskData taskData, IEnumerable<Color> folderColorOptions) { Contract.Requires(null != taskData, "taskData"); m_taskData = taskData; Contract.Requires(null != folderColorOptions, "folderColorOptions"); m_folderColorOptions = folderColorOptions.ToReadOnlyCollection(); Tasks = new TaskListViewModel(taskData, filter); Timeline = new TimelineViewModel(Tasks.AllTasks); Filters = new Filters(taskData); Folders = new Folders(taskData); taskData.PropertyChanged += (sender, args) => { if (args.PropertyName == "CurrentFolder" || args.PropertyName == "Filter") { Tasks.RefreshFilter(); } }; DispatcherTimer dateChanger = new DispatcherTimer(); dateChanger.Interval = TimeSpan.FromMinutes(1); dateChanger.Tick += new EventHandler(dateChanger_Tick); Tasks.RefreshFilter(); }
public Root(TaskData taskData, IEnumerable <Color> folderColorOptions) { Util.RequireNotNull(taskData, "taskData"); m_taskData = taskData; Util.RequireNotNull(folderColorOptions, "folderColorOptions"); m_folderColorOptions = folderColorOptions.ToReadOnlyCollection(); Tasks = new TaskListViewModel(taskData, filter); Timeline = new TimelineViewModel(Tasks.AllTasks); Filters = new Filters(taskData); Folders = new Folders(taskData); taskData.PropertyChanged += (sender, args) => { if (args.PropertyName == "CurrentFolder" || args.PropertyName == "Filter") { Tasks.RefreshFilter(); } }; DispatcherTimer dateChanger = new DispatcherTimer(); dateChanger.Interval = TimeSpan.FromMinutes(1); dateChanger.Tick += new EventHandler(dateChanger_Tick); Tasks.RefreshFilter(); }