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 |
|
143
|
16 |
private float _marginLeft; |
|
17 |
|
|
18 |
public AnnotationViewModel(Annotation a, float marginLeft) { |
69
|
19 |
this._tcBegin = a.TcBegin; |
|
20 |
this._dur = a.Dur; |
|
21 |
this._gestureType = a.GestureType; |
143
|
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 |
} |
143
|
57 |
public float MarginLeft |
|
58 |
{ |
|
59 |
get { return _marginLeft; } |
|
60 |
set |
|
61 |
{ |
|
62 |
if (value == _marginLeft || float.IsNaN(value)) |
|
63 |
return; |
|
64 |
_marginLeft = value; |
|
65 |
base.OnPropertyChanged("MarginLeft"); |
|
66 |
} |
|
67 |
} |
55
|
68 |
|
|
69 |
} |
|
70 |
} |