author | sarias |
Sun, 11 Oct 2009 20:34:56 +0200 | |
changeset 138 | 61ba19954ed4 |
parent 136 | 8b513df1b446 |
child 146 | dd8ed4d3beb6 |
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; |
|
15 |
||
129
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
16 |
private float _marginLeft; |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
17 |
|
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
18 |
public AnnotationViewModel(Annotation a, float marginLeft) { |
69 | 19 |
this._tcBegin = a.TcBegin; |
20 |
this._dur = a.Dur; |
|
21 |
this._gestureType = a.GestureType; |
|
129
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
22 |
this._marginLeft = marginLeft; |
69 | 23 |
} |
24 |
||
25 |
public float TcBegin |
|
55 | 26 |
{ |
27 |
get { return _tcBegin; } |
|
28 |
set { |
|
29 |
if (value == _tcBegin || float.IsNaN(value)) |
|
30 |
return; |
|
31 |
_tcBegin = value; |
|
32 |
base.OnPropertyChanged("TcBegin"); |
|
33 |
} |
|
34 |
} |
|
69 | 35 |
public float Dur |
55 | 36 |
{ |
37 |
get { return _dur; } |
|
38 |
set |
|
39 |
{ |
|
40 |
if (value == _dur || float.IsNaN(value)) |
|
41 |
return; |
|
42 |
_dur = value; |
|
43 |
base.OnPropertyChanged("Dur"); |
|
44 |
} |
|
45 |
} |
|
69 | 46 |
public String GestureType |
55 | 47 |
{ |
48 |
get { return _gestureType; } |
|
49 |
set |
|
50 |
{ |
|
51 |
if (value == _gestureType || String.IsNullOrEmpty(value)) |
|
52 |
return; |
|
53 |
_gestureType = value; |
|
54 |
base.OnPropertyChanged("GestureType"); |
|
55 |
} |
|
56 |
} |
|
129
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
57 |
public float MarginLeft |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
58 |
{ |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
59 |
get { return _marginLeft; } |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
60 |
set |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
61 |
{ |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
62 |
if (value == _marginLeft || float.IsNaN(value)) |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
63 |
return; |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
64 |
_marginLeft = value; |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
65 |
base.OnPropertyChanged("MarginLeft"); |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
66 |
} |
1f37ef03ebee
scale change improved and now annotations can not recover any of them.
cavaliet
parents:
69
diff
changeset
|
67 |
} |
55 | 68 |
|
69 |
} |
|
70 |
} |