|
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 |
|
80 private VideoChapterType _chapter; |
|
81 public VideoChapterType Chapter |
|
82 { |
|
83 get |
|
84 { |
|
85 return _segmentIndex.Chapter.Type; |
|
86 } |
|
87 set |
|
88 { |
|
89 _chapter = value; |
|
90 OnPropertyChanged("Chapter"); |
|
91 } |
|
92 } |
|
93 |
|
94 |
|
95 } |
|
96 } |