author | cavaliet |
Wed, 14 Oct 2009 17:08:43 +0200 | |
changeset 150 | 569925b65604 |
parent 146 | dd8ed4d3beb6 |
child 160 | e940ca798fe3 |
permissions | -rw-r--r-- |
55 | 1 |
using System; |
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
||
69 | 6 |
using FingersDance.Data; |
7 |
||
8 |
namespace FingersDance.ViewModels |
|
55 | 9 |
{ |
69 | 10 |
public class AnnotationViewModel : ViewModelBase |
55 | 11 |
{ |
12 |
private float _tcBegin; |
|
13 |
private float _dur; |
|
14 |
private String _gestureType; |
|
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
15 |
private UInt32 _color; |
55 | 16 |
|
143 | 17 |
private float _marginLeft; |
18 |
||
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
19 |
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
|
20 |
{ |
69 | 21 |
this._tcBegin = a.TcBegin; |
22 |
this._dur = a.Dur; |
|
23 |
this._gestureType = a.GestureType; |
|
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
24 |
this._color = a.Color; |
143 | 25 |
this._marginLeft = marginLeft; |
69 | 26 |
} |
27 |
||
28 |
public float TcBegin |
|
55 | 29 |
{ |
30 |
get { return _tcBegin; } |
|
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
31 |
set |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
32 |
{ |
55 | 33 |
if (value == _tcBegin || float.IsNaN(value)) |
34 |
return; |
|
35 |
_tcBegin = value; |
|
36 |
base.OnPropertyChanged("TcBegin"); |
|
37 |
} |
|
38 |
} |
|
69 | 39 |
public float Dur |
55 | 40 |
{ |
41 |
get { return _dur; } |
|
42 |
set |
|
43 |
{ |
|
44 |
if (value == _dur || float.IsNaN(value)) |
|
45 |
return; |
|
46 |
_dur = value; |
|
47 |
base.OnPropertyChanged("Dur"); |
|
48 |
} |
|
49 |
} |
|
69 | 50 |
public String GestureType |
55 | 51 |
{ |
52 |
get { return _gestureType; } |
|
53 |
set |
|
54 |
{ |
|
55 |
if (value == _gestureType || String.IsNullOrEmpty(value)) |
|
56 |
return; |
|
57 |
_gestureType = value; |
|
58 |
base.OnPropertyChanged("GestureType"); |
|
59 |
} |
|
60 |
} |
|
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
61 |
public UInt32 Color |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
62 |
{ |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
63 |
get { return _color; } |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
64 |
set |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
65 |
{ |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
66 |
if (value == _color) |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
67 |
return; |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
68 |
_color = value; |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
69 |
} |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
70 |
} |
143 | 71 |
public float MarginLeft |
72 |
{ |
|
73 |
get { return _marginLeft; } |
|
74 |
set |
|
75 |
{ |
|
76 |
if (value == _marginLeft || float.IsNaN(value)) |
|
77 |
return; |
|
78 |
_marginLeft = value; |
|
79 |
base.OnPropertyChanged("MarginLeft"); |
|
80 |
} |
|
81 |
} |
|
55 | 82 |
|
83 |
} |
|
84 |
} |