diff -r 97ef988c92c2 -r 25b49d4f1635 src/FingersDance.ViewModel/AnnotationViewModel.cs --- a/src/FingersDance.ViewModel/AnnotationViewModel.cs Wed Oct 28 13:46:38 2009 +0100 +++ b/src/FingersDance.ViewModel/AnnotationViewModel.cs Wed Oct 28 17:07:27 2009 +0100 @@ -10,74 +10,67 @@ { public class AnnotationViewModel : ViewModelBase { - private float _tcBegin; - private float _dur; - private String _gestureType; - private Color _color; + readonly Annotation a; private float _marginLeft; private Double _scaleX = 1; - public AnnotationViewModel(Annotation a, float marginLeft, Double scaleX) + public AnnotationViewModel(Annotation aPar, float marginLeft, Double scaleX) { - this._tcBegin = a.TcBegin; - this._dur = a.Dur; - this._gestureType = a.GestureType; - this._color = a.Color; + a = aPar; + this._marginLeft = marginLeft; this._marginLeft = marginLeft; this._scaleX = scaleX; } - public AnnotationViewModel(Annotation a, float marginLeft) + public AnnotationViewModel(Annotation aPar, float marginLeft) { - this._tcBegin = a.TcBegin; - this._dur = a.Dur; - this._gestureType = a.GestureType; - this._color = a.Color; + a = aPar; + this._marginLeft = marginLeft; } public float TcBegin { - get { return _tcBegin; } + get { return a.TcBegin; } set { - if (value == _tcBegin || float.IsNaN(value)) + if (value == a.TcBegin || float.IsNaN(value)) return; - _tcBegin = value; + a.TcBegin = value; base.OnPropertyChanged("TcBegin"); } } public float Dur { - get { return _dur; } + get { return a.Dur; } set { - if (value == _dur || float.IsNaN(value)) + if (value == a.Dur || float.IsNaN(value)) return; - _dur = value; + a.Dur = value; base.OnPropertyChanged("Dur"); } } public String GestureType { - get { return _gestureType; } + get { return a.GestureType; } set { - if (value == _gestureType || String.IsNullOrEmpty(value)) + if (value == a.GestureType || String.IsNullOrEmpty(value)) return; - _gestureType = value; + a.GestureType = value; base.OnPropertyChanged("GestureType"); } } public Color Color { - get { return _color; } + get { return a.Color; } set { - if (value == _color) + if (value == a.Color) return; - _color = value; + a.Color = value; } } public float MarginLeft