private void ProjectsComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     foreach (var p in Projects)
     {
         Braincase.GanttChart.Task _task = p.Tasks.FirstOrDefault();
         if (_task == ((Braincase.GanttChart.Task)ProjectsComboBox.SelectedItem))
         {
             _Chart.Init(p);
             _Chart.Invalidate();
             GanttHost.InvalidateVisual();
             return;
         }
     }
 }
        private void TimeViewComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var item = TimeViewComboBox.SelectedItem;

            if (item == null)
            {
                return;
            }
            switch (((TimeResolution)Enum.Parse(typeof(TimeResolution), item.ToString())))
            {
            case TimeResolution.Day:
                this._Chart.TimeResolution = TimeResolution.Day;
                _Chart.Invalidate();
                GanttHost.InvalidateVisual();
                break;

            case TimeResolution.Week:
                this._Chart.TimeResolution = TimeResolution.Week;
                _Chart.Invalidate();
                GanttHost.InvalidateVisual();
                break;
            }
        }