コード例 #1
0
        private void icPlanningUserStories_MouseUp(object sender, MouseButtonEventArgs e)
        {
            var itemsControl = sender as ItemsControl;
            var item         = UICommon.FindAncestor <TaskControl>((DependencyObject)e.OriginalSource);

            if (item == null || item.DataContext == null)
            {
                return;
            }

            foreach (DisplayTask task in itemsControl.ItemsSource)
            {
                task.BorderColor = task.DefaultBorderColor;
            }

            PlanningSelectedUserStory             = (DisplayTask)item.DataContext;
            PlanningSelectedUserStory.BorderColor = "Red";

            if (PlanningSelectedUserStory.ID == -1)
            {
                icPlanningTasks.ItemsSource = UnestimatedTasks;
            }
            else
            {
                PlanningSelectedUserStory.LinkedTasks = WIC.GetRelatedWorkItems(PlanningSelectedUserStory.workItem);
                icPlanningTasks.ItemsSource           = PlanningSelectedUserStory.LinkedTasks;
            }
        }
コード例 #2
0
        public WorkItemDetails(DisplayTask root)
        {
            InitializeComponent();

            WIC = Application.Current.Properties["WIC"] as WorkItemController;

            root.LinkedTasks = WIC.GetRelatedWorkItems(root.workItem);

            var tasks = new ObservableCollection <DisplayTask>(root.LinkedTasks);

            tasks.Insert(0, root);

            icDetailTasks.ItemsSource = tasks;

            detailTaskEditor.DataContext = root;
        }