blob: 66be7bd04d54bc0216097b3d07c41cfc8168c2f6 (
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
using Tango.BL.Enumerations;
using Tango.Core.Commands;
using Tango.SharedUI;
namespace Tango.PPC.Jobs.Dialogs
{
/// <summary>
/// Represents the a job type picker view model
/// </summary>
/// <seealso cref="Tango.SharedUI.DialogViewVM" />
public class JobCreationViewVM : DialogViewVM
{
private String _jobName;
public String JobName
{
get { return _jobName; }
set { _jobName = value;
RaisePropertyChangedAuto();
InvalidateRelayCommands();
}
}
private List<Rml> _rmls;
/// <summary>
/// Gets or sets the available RMLS.
/// </summary>
public List<Rml> Rmls
{
get { return _rmls; }
set { _rmls = value; RaisePropertyChangedAuto(); }
}
private Rml _selectedRML;
/// <summary>
/// Gets or sets the selected RML.
/// </summary>
public Rml SelectedRML
{
get { return _selectedRML; }
set { _selectedRML = value;
RaisePropertyChangedAuto();
}
}
private List<SpoolType> _spoolTypes;
/// <summary>
/// Gets or sets the available spool types.
/// </summary>
public List<SpoolType> SpoolTypes
{
get { return _spoolTypes; }
set { _spoolTypes = value;
RaisePropertyChangedAuto(); }
}
private SpoolType _selectedSpoolType;
public SpoolType SelectedSpoolType
{
get { return _selectedSpoolType; }
set { _selectedSpoolType = value;
RaisePropertyChangedAuto(); }
}
private double _whiteGap;
public double WhiteGap
{
get { return _whiteGap; }
set { _whiteGap = value;
RaisePropertyChangedAuto();
}
}
private bool _showDuplicate;
public bool ShowDuplicate
{
get { return _showDuplicate; }
set { _showDuplicate = value;
RaisePropertyChangedAuto();
}
}
public bool IsDuplicate { get; set; }
public RelayCommand DuplicateCommand { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="JobCreationViewVM"/> class.
/// </summary>
/// <param name="supportedJobTypes">The supported job types.</param>
/// <param name="supportedColorSpaces">The supported color spaces</param>
public JobCreationViewVM(List<SpoolType> spoolTypes, List<Rml> rmls, double whitegap, bool showDuplicate) : base()
{
JobName = "Unnamed";
SpoolTypes = spoolTypes;
Rmls = rmls.OrderBy(x => x.Name).ToList();
DuplicateCommand = new RelayCommand(Duplicate);
IsDuplicate = false;
ShowDuplicate = showDuplicate;
WhiteGap = whitegap;
}
private void Duplicate(object obj)
{
IsDuplicate = true;
Accept();
}
protected override bool CanOK()
{
return false == String.IsNullOrEmpty(JobName);
}
}
}
|