aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ReportIssueViewVM.cs
blob: 2935ff81b74b268892f83ead4b74cbb019036454 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.MachineStudio.Common.Notifications;
using Tango.MachineStudio.UI.TFS;
using Tango.SharedUI;
using Tango.SharedUI.Components;
using Tango.TFS;

namespace Tango.MachineStudio.UI.ViewModels
{
    public class ReportIssueViewVM : DialogViewVM
    {
        public SelectedObjectCollection<Tag> SelectedTags { get; set; }

        public Project Project { get; set; }

        [WorkItemValidation]
        public WorkItem WorkItem { get; set; }

        public ReportIssueViewVM() : base()
        {

        }

        public ReportIssueViewVM(Project project, WorkItem workItem) : this()
        {
            Project = project;
            WorkItem = workItem;
            SelectedTags = new SelectedObjectCollection<Tag>(Project.Tags.ToObservableCollection(), new System.Collections.ObjectModel.ObservableCollection<Tag>());
        }

        protected override void Accept()
        {
            if (Validate())
            {
                WorkItem.Tags = SelectedTags.SynchedSource.ToList();
                base.Accept();
            }
        }
    }
}