client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/CustomableIndexElementVM.cs
author totetm <>
Fri, 12 Feb 2010 16:22:57 +0100
changeset 47 9b26023b8c83
parent 36 b6df6fce6e5d
permissions -rw-r--r--
Fixed| bug si on ferme un livre en le lisant ReFixed|faire fonctionner le seek, même quand play n'est pas activer

using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Iri.Modernisation.Data.Models;
using Iri.Modernisation.Controls.View;
namespace Iri.Modernisation.Controls.ViewModel
{
    public class CustomableIndexElementVM : BaseMVVM.ViewModel.ViewModel
    {
        public CustomableIndexElementVM(SegmentIndex paramSeg)
        {

            _segmentIndex = paramSeg;

            _timerIn = paramSeg.TimerIn;
            _timerOut = paramSeg.TimerOut;
  

            OnPropertyChanged("Duration");
        }

        private SegmentIndex _segmentIndex;
        public SegmentIndex SegmentIndex
        {
            get
            {
                return _segmentIndex;
            }
        }

        private TimeSpan _timerIn;
        public TimeSpan TimerIn
        {
            get
            {
                return _timerIn;
            }
            set
            {
                _timerIn = value;
                _segmentIndex.TimerIn = value;
                OnPropertyChanged(String.Empty);
            }
        }

        private TimeSpan _timerOut;
        public TimeSpan TimerOut
        {
            get
            {
                return _timerOut;
            }
            set
            {
                _timerOut = value;
                _segmentIndex.TimerOut = value;
                OnPropertyChanged(String.Empty);
            }
        }

        
        public double Duration
        {
            get
            {
            
                return ((TimeSpan)(TimerOut - TimerIn)).TotalMilliseconds * ProductionTimeLine.ScaleTime;

            }
            
        }

        private Color _chapterColor;
        public Color ChapterColor
        {
            get
            {
                return _chapterColor;
            }
            set
            {
                _chapterColor = value;
                OnPropertyChanged("ChapterColor");
            }
        }
        public SolidColorBrush ChapterSolidColorBrush
        {
            get
            {
                return new SolidColorBrush(this.ChapterColor);
            }
        }

      
    }
}