src/FingersDance.ViewModel/AnnotationViewModel.cs
author cavaliet
Wed, 14 Oct 2009 17:08:43 +0200
changeset 150 569925b65604
parent 146 dd8ed4d3beb6
child 160 e940ca798fe3
permissions -rw-r--r--
Annotations are now colored with the same color as the pivot's button

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using FingersDance.Data;

namespace FingersDance.ViewModels
{
    public class AnnotationViewModel : ViewModelBase
    {
        private float _tcBegin;
        private float _dur;
        private String _gestureType;
        private UInt32 _color;

        private float _marginLeft;

        public AnnotationViewModel(Annotation a, float marginLeft)
        {
            this._tcBegin = a.TcBegin;
            this._dur = a.Dur;
            this._gestureType = a.GestureType;
            this._color = a.Color;
            this._marginLeft = marginLeft;
        }

        public float TcBegin
        {
            get { return _tcBegin; }
            set
            {
                if (value == _tcBegin || float.IsNaN(value))
                    return;
                _tcBegin = value;
                base.OnPropertyChanged("TcBegin");
            }
        }
        public float Dur
        {
            get { return _dur; }
            set
            {
                if (value == _dur || float.IsNaN(value))
                    return;
                _dur = value;
                base.OnPropertyChanged("Dur");
            }
        }
        public String GestureType
        {
            get { return _gestureType; }
            set
            {
                if (value == _gestureType || String.IsNullOrEmpty(value))
                    return;
                _gestureType = value;
                base.OnPropertyChanged("GestureType");
            }
        }
        public UInt32 Color
        {
            get { return _color; }
            set
            {
                if (value == _color)
                    return;
                _color = value;
            }
        }
        public float MarginLeft
        {
            get { return _marginLeft; }
            set
            {
                if (value == _marginLeft || float.IsNaN(value))
                    return;
                _marginLeft = value;
                base.OnPropertyChanged("MarginLeft");
            }
        }

    }
}