|
20
|
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.Data.Models; |
|
|
12 |
using Iri.Modernisation.Controls.View; |
|
|
13 |
namespace Iri.Modernisation.Controls.ViewModel |
|
|
14 |
{ |
|
|
15 |
public class CustomableIndexElementVM : BaseMVVM.ViewModel.ViewModel |
|
|
16 |
{ |
|
|
17 |
public CustomableIndexElementVM(SegmentIndex paramSeg) |
|
|
18 |
{ |
|
|
19 |
|
|
|
20 |
_segmentIndex = paramSeg; |
|
|
21 |
|
|
|
22 |
_timerIn = paramSeg.TimerIn; |
|
|
23 |
_timerOut = paramSeg.TimerOut; |
|
|
24 |
|
|
|
25 |
|
|
|
26 |
OnPropertyChanged("Duration"); |
|
|
27 |
} |
|
|
28 |
|
|
|
29 |
private SegmentIndex _segmentIndex; |
|
|
30 |
public SegmentIndex SegmentIndex |
|
|
31 |
{ |
|
|
32 |
get |
|
|
33 |
{ |
|
|
34 |
return _segmentIndex; |
|
|
35 |
} |
|
|
36 |
} |
|
|
37 |
|
|
|
38 |
private TimeSpan _timerIn; |
|
|
39 |
public TimeSpan TimerIn |
|
|
40 |
{ |
|
|
41 |
get |
|
|
42 |
{ |
|
|
43 |
return _timerIn; |
|
|
44 |
} |
|
|
45 |
set |
|
|
46 |
{ |
|
|
47 |
_timerIn = value; |
|
|
48 |
_segmentIndex.TimerIn = value; |
|
|
49 |
OnPropertyChanged(String.Empty); |
|
|
50 |
} |
|
|
51 |
} |
|
|
52 |
|
|
|
53 |
private TimeSpan _timerOut; |
|
|
54 |
public TimeSpan TimerOut |
|
|
55 |
{ |
|
|
56 |
get |
|
|
57 |
{ |
|
|
58 |
return _timerOut; |
|
|
59 |
} |
|
|
60 |
set |
|
|
61 |
{ |
|
|
62 |
_timerOut = value; |
|
|
63 |
_segmentIndex.TimerOut = value; |
|
|
64 |
OnPropertyChanged(String.Empty); |
|
|
65 |
} |
|
|
66 |
} |
|
|
67 |
|
|
|
68 |
|
|
|
69 |
public double Duration |
|
|
70 |
{ |
|
|
71 |
get |
|
|
72 |
{ |
|
|
73 |
//MessageBox.Show(((TimeSpan)(TimerOut - TimerIn)).TotalMilliseconds.ToString()); |
|
|
74 |
return ((TimeSpan)(TimerOut - TimerIn)).TotalMilliseconds * ProductionTimeLine.ScaleTime; |
|
|
75 |
|
|
|
76 |
} |
|
|
77 |
|
|
|
78 |
} |
|
|
79 |
|
|
27
|
80 |
private Color _chapterColor; |
|
|
81 |
public Color ChapterColor |
|
20
|
82 |
{ |
|
|
83 |
get |
|
|
84 |
{ |
|
27
|
85 |
return _chapterColor; |
|
20
|
86 |
} |
|
|
87 |
set |
|
|
88 |
{ |
|
27
|
89 |
_chapterColor = value; |
|
|
90 |
OnPropertyChanged("ChapterColor"); |
|
|
91 |
} |
|
|
92 |
} |
|
|
93 |
public SolidColorBrush ChapterSolidColorBrush |
|
|
94 |
{ |
|
|
95 |
get |
|
|
96 |
{ |
|
|
97 |
return new SolidColorBrush(this.ChapterColor); |
|
20
|
98 |
} |
|
|
99 |
} |
|
|
100 |
|
|
|
101 |
|
|
|
102 |
} |
|
|
103 |
} |