|
0
|
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.Commands; |
|
|
12 |
using Iri.Modernisation.BaseMVVM.ViewModel; |
|
|
13 |
namespace Iri.Modernisation.Controls.ViewModel |
|
|
14 |
{ |
|
|
15 |
public class VideoViewerVM : BaseMVVM.ViewModel.ViewModel |
|
|
16 |
{ |
|
|
17 |
|
|
|
18 |
private String _source; |
|
|
19 |
public String Source |
|
|
20 |
{ |
|
|
21 |
get |
|
|
22 |
{ |
|
|
23 |
return _source; |
|
|
24 |
} |
|
|
25 |
set |
|
|
26 |
{ |
|
|
27 |
_source = value; |
|
|
28 |
|
|
|
29 |
OnPropertyChanged(null); |
|
|
30 |
} |
|
|
31 |
} |
|
|
32 |
public Uri USource |
|
|
33 |
{ |
|
|
34 |
get |
|
|
35 |
{ |
|
|
36 |
if (Source != null) |
|
|
37 |
{ |
|
|
38 |
return new Uri(Source, UriKind.RelativeOrAbsolute); |
|
|
39 |
} |
|
|
40 |
else |
|
|
41 |
{ |
|
|
42 |
return null; |
|
|
43 |
} |
|
|
44 |
} |
|
|
45 |
|
|
|
46 |
} |
|
15
|
47 |
|
|
0
|
48 |
public String Info |
|
|
49 |
{ |
|
|
50 |
get |
|
|
51 |
{ |
|
|
52 |
return position + ":" + Source; |
|
|
53 |
} |
|
|
54 |
|
|
|
55 |
} |
|
15
|
56 |
|
|
0
|
57 |
private TimeSpan position = new TimeSpan(0,0,0); |
|
|
58 |
public TimeSpan Position |
|
|
59 |
{ |
|
|
60 |
get |
|
|
61 |
{ |
|
|
62 |
return position; |
|
|
63 |
} |
|
|
64 |
set |
|
|
65 |
{ |
|
|
66 |
position = value; |
|
|
67 |
//OnPropertyChanged("Position"); |
|
|
68 |
OnPropertyChanged("Info"); |
|
|
69 |
|
|
|
70 |
} |
|
|
71 |
} |
|
15
|
72 |
|
|
|
73 |
private bool _playControl; |
|
|
74 |
public bool PlayControl |
|
|
75 |
{ |
|
|
76 |
get |
|
|
77 |
{ |
|
|
78 |
return _playControl; |
|
|
79 |
} |
|
|
80 |
set |
|
|
81 |
{ |
|
|
82 |
_playControl = value; |
|
|
83 |
OnPropertyChanged("PlayControl"); |
|
|
84 |
} |
|
|
85 |
} |
|
|
86 |
|
|
|
87 |
private bool _recordControl; |
|
|
88 |
public bool RecordControl |
|
|
89 |
{ |
|
|
90 |
get |
|
|
91 |
{ |
|
|
92 |
return _recordControl; |
|
|
93 |
} |
|
|
94 |
set |
|
|
95 |
{ |
|
|
96 |
_recordControl = value; |
|
|
97 |
OnPropertyChanged("RecordControl"); |
|
|
98 |
} |
|
|
99 |
} |
|
|
100 |
public VideoViewerVM(bool playControl,bool recordControl ) |
|
|
101 |
{ |
|
|
102 |
_playControl = playControl; |
|
|
103 |
_recordControl = recordControl; |
|
|
104 |
InitializeCommands(); |
|
|
105 |
} |
|
|
106 |
private void InitializeCommands() |
|
0
|
107 |
{ |
|
|
108 |
Commands.VideoViewer.SendPosition.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(SendPosition_Executed); |
|
|
109 |
//Commands.GoToTime.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(GoToTime_Executed); |
|
15
|
110 |
|
|
0
|
111 |
} |
|
|
112 |
void SendPosition_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) |
|
|
113 |
{ |
|
|
114 |
//Position = (TimeSpan)(e.Parameter); |
|
|
115 |
} |
|
|
116 |
|
|
|
117 |
|
|
|
118 |
|
|
|
119 |
} |
|
|
120 |
} |