src/FingersDance.ViewModel/AnnotationViewModel.cs
changeset 69 a4c44555f205
parent 55 1ec0ef228158
child 129 1f37ef03ebee
child 143 9f157d9c725b
equal deleted inserted replaced
68:5f547156bda6 69:a4c44555f205
     1 using System;
     1 using System;
     2 using System.Collections.Generic;
     2 using System.Collections.Generic;
     3 using System.Linq;
     3 using System.Linq;
     4 using System.Text;
     4 using System.Text;
     5 
     5 
     6 namespace FingersDance.ViewModel
     6 using FingersDance.Data;
       
     7 
       
     8 namespace FingersDance.ViewModels
     7 {
     9 {
     8     class AnnotationViewModel : ViewModelBase
    10     public class AnnotationViewModel : ViewModelBase
     9     {
    11     {
    10         private float _tcBegin;
    12         private float _tcBegin;
    11         private float _dur;
    13         private float _dur;
    12         private String _gestureType;
    14         private String _gestureType;
    13 
    15 
    14         public float tcBegin
    16         public AnnotationViewModel(Annotation a) {
       
    17             this._tcBegin = a.TcBegin;
       
    18             this._dur = a.Dur;
       
    19             this._gestureType = a.GestureType;
       
    20         }
       
    21 
       
    22         public float TcBegin
    15         {
    23         {
    16             get { return _tcBegin; }
    24             get { return _tcBegin; }
    17             set {
    25             set {
    18                 if (value == _tcBegin || float.IsNaN(value))
    26                 if (value == _tcBegin || float.IsNaN(value))
    19                     return;
    27                     return;
    20                 _tcBegin = value;
    28                 _tcBegin = value;
    21                 base.OnPropertyChanged("TcBegin");
    29                 base.OnPropertyChanged("TcBegin");
    22             }
    30             }
    23         }
    31         }
    24         public float dur
    32         public float Dur
    25         {
    33         {
    26             get { return _dur; }
    34             get { return _dur; }
    27             set
    35             set
    28             {
    36             {
    29                 if (value == _dur || float.IsNaN(value))
    37                 if (value == _dur || float.IsNaN(value))
    30                     return;
    38                     return;
    31                 _dur = value;
    39                 _dur = value;
    32                 base.OnPropertyChanged("Dur");
    40                 base.OnPropertyChanged("Dur");
    33             }
    41             }
    34         }
    42         }
    35         public String gestureType
    43         public String GestureType
    36         {
    44         {
    37             get { return _gestureType; }
    45             get { return _gestureType; }
    38             set
    46             set
    39             {
    47             {
    40                 if (value == _gestureType || String.IsNullOrEmpty(value))
    48                 if (value == _gestureType || String.IsNullOrEmpty(value))