author | cavaliet |
Fri, 16 Oct 2009 15:56:09 +0200 | |
changeset 160 | e940ca798fe3 |
parent 150 | 569925b65604 |
child 167 | 206f07a8d887 |
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; |
19 |
||
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
20 |
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
|
21 |
{ |
69 | 22 |
this._tcBegin = a.TcBegin; |
23 |
this._dur = a.Dur; |
|
24 |
this._gestureType = a.GestureType; |
|
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
25 |
this._color = a.Color; |
143 | 26 |
this._marginLeft = marginLeft; |
69 | 27 |
} |
28 |
||
29 |
public float TcBegin |
|
55 | 30 |
{ |
31 |
get { return _tcBegin; } |
|
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
32 |
set |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
33 |
{ |
55 | 34 |
if (value == _tcBegin || float.IsNaN(value)) |
35 |
return; |
|
36 |
_tcBegin = value; |
|
37 |
base.OnPropertyChanged("TcBegin"); |
|
38 |
} |
|
39 |
} |
|
69 | 40 |
public float Dur |
55 | 41 |
{ |
42 |
get { return _dur; } |
|
43 |
set |
|
44 |
{ |
|
45 |
if (value == _dur || float.IsNaN(value)) |
|
46 |
return; |
|
47 |
_dur = value; |
|
48 |
base.OnPropertyChanged("Dur"); |
|
49 |
} |
|
50 |
} |
|
69 | 51 |
public String GestureType |
55 | 52 |
{ |
53 |
get { return _gestureType; } |
|
54 |
set |
|
55 |
{ |
|
56 |
if (value == _gestureType || String.IsNullOrEmpty(value)) |
|
57 |
return; |
|
58 |
_gestureType = value; |
|
59 |
base.OnPropertyChanged("GestureType"); |
|
60 |
} |
|
61 |
} |
|
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
|
62 |
public Color Color |
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
63 |
{ |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
64 |
get { return _color; } |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
65 |
set |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
66 |
{ |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
67 |
if (value == _color) |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
68 |
return; |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
69 |
_color = value; |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
70 |
} |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
71 |
} |
143 | 72 |
public float MarginLeft |
73 |
{ |
|
74 |
get { return _marginLeft; } |
|
75 |
set |
|
76 |
{ |
|
77 |
if (value == _marginLeft || float.IsNaN(value)) |
|
78 |
return; |
|
79 |
_marginLeft = value; |
|
80 |
base.OnPropertyChanged("MarginLeft"); |
|
81 |
} |
|
82 |
} |
|
55 | 83 |
|
84 |
} |
|
85 |
} |