| author | Matthieu Totet |
| Mon, 14 Dec 2009 17:02:03 +0100 | |
| changeset 23 | 10acb6a11a73 |
| parent 22 | 69a2910ec6f9 |
| child 25 | a9c815025a1b |
| permissions | -rw-r--r-- |
| 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 |
} |
|
| 22 | 106 |
public event EventHandler<VideoViewerVMEventArgs> Tick; |
107 |
||
| 15 | 108 |
private void InitializeCommands() |
| 0 | 109 |
{ |
| 22 | 110 |
|
| 0 | 111 |
} |
|
23
10acb6a11a73
Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents:
22
diff
changeset
|
112 |
public void GoTo(TimeSpan pos) |
|
10acb6a11a73
Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents:
22
diff
changeset
|
113 |
{ |
|
10acb6a11a73
Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents:
22
diff
changeset
|
114 |
Position = pos; |
|
10acb6a11a73
Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents:
22
diff
changeset
|
115 |
Commands.GoToTime.Execute(Position,this); |
|
10acb6a11a73
Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents:
22
diff
changeset
|
116 |
} |
| 22 | 117 |
public void LaunchTick(TimeSpan Pos) |
| 0 | 118 |
{ |
| 22 | 119 |
if(Tick!=null) |
120 |
{ |
|
121 |
Tick(this, new VideoViewerVMEventArgs(Pos)); |
|
122 |
} |
|
| 0 | 123 |
} |
124 |
|
|
125 |
||
126 |
} |
|
| 22 | 127 |
public class VideoViewerVMEventArgs : EventArgs |
128 |
{ |
|
|
23
10acb6a11a73
Update VideoViewer ( Allow Multi-VideoViewer)
Matthieu Totet
parents:
22
diff
changeset
|
129 |
public TimeSpan Position { get; set; } |
| 22 | 130 |
public VideoViewerVMEventArgs(TimeSpan pos) |
131 |
{ |
|
132 |
Position = pos; |
|
133 |
} |
|
134 |
} |
|
| 0 | 135 |
} |