|
21
|
1 |
using System; |
|
|
2 |
using System.Net; |
|
|
3 |
using System.Windows; |
|
|
4 |
using System.Windows.Controls; |
|
|
5 |
using System.Windows.Documents; |
|
|
6 |
using System.Windows.Ink; |
|
|
7 |
using System.Windows.Input; |
|
|
8 |
using System.Windows.Media; |
|
|
9 |
using System.Windows.Media.Animation; |
|
|
10 |
using System.Windows.Shapes; |
|
|
11 |
using Iri.Modernisation.BaseMVVM; |
|
|
12 |
using Iri.Modernisation.Data.Models; |
|
|
13 |
using System.Collections.Generic; |
|
|
14 |
using System.Linq; |
|
|
15 |
using Iri.Modernisation.BaseMVVM.Commands; |
|
|
16 |
namespace Iri.Modernisation.Controls.ViewModel |
|
|
17 |
{ |
|
|
18 |
public class ProductionEditorVM: BaseMVVM.ViewModel.ViewModel |
|
|
19 |
{ |
|
|
20 |
private VideoViewerVM _videoViewerVM; |
|
|
21 |
public VideoViewerVM ViewModelVideoViewer |
|
|
22 |
{ |
|
|
23 |
get |
|
|
24 |
{ |
|
|
25 |
return _videoViewerVM; |
|
|
26 |
} |
|
|
27 |
set |
|
|
28 |
{ |
|
|
29 |
_videoViewerVM = value; |
|
|
30 |
OnPropertyChanged("ViewModelVideoViewer"); |
|
|
31 |
} |
|
|
32 |
} |
|
|
33 |
|
|
|
34 |
private PolemicElement _selectedSegmentIndex; |
|
|
35 |
|
|
|
36 |
private String _selectedIndexTitle; |
|
|
37 |
public String SelectedIndexTitle |
|
|
38 |
{ |
|
|
39 |
get |
|
|
40 |
{ |
|
|
41 |
return _selectedIndexTitle; |
|
|
42 |
} |
|
|
43 |
set |
|
|
44 |
{ |
|
|
45 |
_selectedIndexTitle = value; |
|
|
46 |
_selectedSegmentIndex.Title = value; |
|
|
47 |
OnPropertyChanged("SelectedIndexTitle"); |
|
|
48 |
} |
|
|
49 |
} |
|
|
50 |
|
|
|
51 |
private String _selectedIndexDescription; |
|
|
52 |
public String SelectedIndexDescription |
|
|
53 |
{ |
|
|
54 |
get |
|
|
55 |
{ |
|
|
56 |
return _selectedIndexDescription; |
|
|
57 |
} |
|
|
58 |
set |
|
|
59 |
{ |
|
|
60 |
_selectedIndexDescription = value; |
|
|
61 |
_selectedSegmentIndex.Description = value; |
|
|
62 |
OnPropertyChanged("SelectedIndexDescription"); |
|
|
63 |
} |
|
|
64 |
} |
|
|
65 |
|
|
|
66 |
private List<String> _selectedIndexTags = new List<String>(); |
|
|
67 |
public String SelectedIndexTags |
|
|
68 |
{ |
|
|
69 |
get |
|
|
70 |
{ |
|
|
71 |
try |
|
|
72 |
{ |
|
|
73 |
return String.Join(",", _selectedIndexTags.ToArray()); |
|
|
74 |
} |
|
|
75 |
catch |
|
|
76 |
{ |
|
|
77 |
return String.Empty; |
|
|
78 |
} |
|
|
79 |
} |
|
|
80 |
set |
|
|
81 |
{ |
|
|
82 |
String val = (String)value; |
|
|
83 |
_selectedIndexTags = val.Split(',').ToList(); |
|
|
84 |
_selectedSegmentIndex.Tags = val.Split(',').ToList(); |
|
|
85 |
OnPropertyChanged("Tags"); |
|
|
86 |
|
|
|
87 |
|
|
|
88 |
} |
|
|
89 |
} |
|
|
90 |
|
|
|
91 |
private bool _isRecordMode; |
|
|
92 |
public bool IsRecordMode |
|
|
93 |
{ |
|
|
94 |
get |
|
|
95 |
{ |
|
|
96 |
return _isRecordMode; |
|
|
97 |
} |
|
|
98 |
set |
|
|
99 |
{ |
|
|
100 |
_isRecordMode = value; |
|
|
101 |
OnPropertyChanged("IsRecordMode"); |
|
|
102 |
} |
|
|
103 |
} |
|
|
104 |
|
|
|
105 |
private bool _isEditableIndex; |
|
|
106 |
public bool IsEditableIndex |
|
|
107 |
{ |
|
|
108 |
get |
|
|
109 |
{ |
|
|
110 |
return _isEditableIndex; |
|
|
111 |
} |
|
|
112 |
set |
|
|
113 |
{ |
|
|
114 |
_isEditableIndex = value; |
|
|
115 |
OnPropertyChanged("IsEditableIndex"); |
|
|
116 |
} |
|
|
117 |
} |
|
|
118 |
|
|
|
119 |
public ProductionEditorVM() |
|
|
120 |
{ |
|
|
121 |
Commands.ProductionTimeLine.IndexSelected.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(IndexSelected_Executed); |
|
|
122 |
|
|
|
123 |
} |
|
|
124 |
|
|
|
125 |
void IndexSelected_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) |
|
|
126 |
{ |
|
|
127 |
IsEditableIndex = (bool)e.Parameter; |
|
|
128 |
_selectedSegmentIndex = (SegmentIndex)e.Source; |
|
|
129 |
_selectedIndexTitle = _selectedSegmentIndex.Title; |
|
|
130 |
_selectedIndexTags = _selectedSegmentIndex.Tags; |
|
|
131 |
_selectedIndexDescription = _selectedSegmentIndex.Description; |
|
|
132 |
OnPropertyChanged(String.Empty); |
|
|
133 |
} |
|
|
134 |
} |
|
|
135 |
} |