author | ARIAS Santiago |
Mon, 26 Oct 2009 08:36:15 +0100 | |
changeset 173 | e99fe78cd168 |
parent 167 | 206f07a8d887 |
child 182 | 25b49d4f1635 |
permissions | -rw-r--r-- |
55 | 1 |
using System; |
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
160
e940ca798fe3
Enhance color factory and send the current project (data) to the timeline instance in order to build the project's cutting's annotation list.
cavaliet
parents:
150
diff
changeset
|
5 |
using System.Windows.Media; |
55 | 6 |
|
69 | 7 |
using FingersDance.Data; |
8 |
||
9 |
namespace FingersDance.ViewModels |
|
55 | 10 |
{ |
69 | 11 |
public class AnnotationViewModel : ViewModelBase |
55 | 12 |
{ |
13 |
private float _tcBegin; |
|
14 |
private float _dur; |
|
15 |
private String _gestureType; |
|
160
e940ca798fe3
Enhance color factory and send the current project (data) to the timeline instance in order to build the project's cutting's annotation list.
cavaliet
parents:
150
diff
changeset
|
16 |
private Color _color; |
55 | 17 |
|
143 | 18 |
private float _marginLeft; |
167
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
19 |
private Double _scaleX = 1; |
143 | 20 |
|
167
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
21 |
public AnnotationViewModel(Annotation a, float marginLeft, Double scaleX) |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
22 |
{ |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
23 |
this._tcBegin = a.TcBegin; |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
24 |
this._dur = a.Dur; |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
25 |
this._gestureType = a.GestureType; |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
26 |
this._color = a.Color; |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
27 |
this._marginLeft = marginLeft; |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
28 |
this._marginLeft = marginLeft; |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
29 |
this._scaleX = scaleX; |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
30 |
} |
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
31 |
public AnnotationViewModel(Annotation a, float marginLeft) |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
32 |
{ |
69 | 33 |
this._tcBegin = a.TcBegin; |
34 |
this._dur = a.Dur; |
|
35 |
this._gestureType = a.GestureType; |
|
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
36 |
this._color = a.Color; |
143 | 37 |
this._marginLeft = marginLeft; |
69 | 38 |
} |
39 |
||
40 |
public float TcBegin |
|
55 | 41 |
{ |
42 |
get { return _tcBegin; } |
|
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
43 |
set |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
44 |
{ |
55 | 45 |
if (value == _tcBegin || float.IsNaN(value)) |
46 |
return; |
|
47 |
_tcBegin = value; |
|
48 |
base.OnPropertyChanged("TcBegin"); |
|
49 |
} |
|
50 |
} |
|
69 | 51 |
public float Dur |
55 | 52 |
{ |
53 |
get { return _dur; } |
|
54 |
set |
|
55 |
{ |
|
56 |
if (value == _dur || float.IsNaN(value)) |
|
57 |
return; |
|
58 |
_dur = value; |
|
59 |
base.OnPropertyChanged("Dur"); |
|
60 |
} |
|
61 |
} |
|
69 | 62 |
public String GestureType |
55 | 63 |
{ |
64 |
get { return _gestureType; } |
|
65 |
set |
|
66 |
{ |
|
67 |
if (value == _gestureType || String.IsNullOrEmpty(value)) |
|
68 |
return; |
|
69 |
_gestureType = value; |
|
70 |
base.OnPropertyChanged("GestureType"); |
|
71 |
} |
|
72 |
} |
|
160
e940ca798fe3
Enhance color factory and send the current project (data) to the timeline instance in order to build the project's cutting's annotation list.
cavaliet
parents:
150
diff
changeset
|
73 |
public Color Color |
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
74 |
{ |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
75 |
get { return _color; } |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
76 |
set |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
77 |
{ |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
78 |
if (value == _color) |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
79 |
return; |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
80 |
_color = value; |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
81 |
} |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
82 |
} |
143 | 83 |
public float MarginLeft |
84 |
{ |
|
85 |
get { return _marginLeft; } |
|
86 |
set |
|
87 |
{ |
|
88 |
if (value == _marginLeft || float.IsNaN(value)) |
|
89 |
return; |
|
90 |
_marginLeft = value; |
|
91 |
base.OnPropertyChanged("MarginLeft"); |
|
92 |
} |
|
93 |
} |
|
167
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
94 |
public Double ScaleX |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
95 |
{ |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
96 |
get { return _scaleX; } |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
97 |
set |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
98 |
{ |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
99 |
if (value == _scaleX || Double.IsNaN(value)) |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
100 |
return; |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
101 |
_scaleX = value; |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
102 |
base.OnPropertyChanged("ScaleX"); |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
103 |
} |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
104 |
} |
55 | 105 |
|
106 |
} |
|
107 |
} |