client/src/Iri.Modernisation.Controls/View/ProductionTimeLine/CustomableIndexElement.xaml.cs
changeset 20 c2dd8119a6c1
child 34 4d9ebc6fbbe8
equal deleted inserted replaced
19:7d044e7562ea 20:c2dd8119a6c1
       
     1 using System;
       
     2 using System.Collections.Generic;
       
     3 using System.Linq;
       
     4 using System.Net;
       
     5 using System.Windows;
       
     6 using System.Windows.Controls;
       
     7 using System.Windows.Documents;
       
     8 using System.Windows.Input;
       
     9 using System.Windows.Media;
       
    10 using System.Windows.Media.Animation;
       
    11 using System.Windows.Shapes;
       
    12 using Iri.Modernisation.Controls.ViewModel;
       
    13 namespace Iri.Modernisation.Controls.View
       
    14 {
       
    15     public partial class CustomableIndexElement : UserControl
       
    16     {
       
    17         
       
    18 
       
    19 
       
    20 
       
    21         public double TrimRight
       
    22         {
       
    23             get { return (double)GetValue(TrimRightProperty); }
       
    24             set
       
    25             {
       
    26                 if (((CustomableIndexElementVM)DataContext).TimerOut>TimeSpan.Zero)
       
    27                 {
       
    28                     SetValue(TrimRightProperty, value);
       
    29                     ((CustomableIndexElementVM)DataContext).TimerOut = ((CustomableIndexElementVM)DataContext).TimerOut.Subtract(new TimeSpan(0, 0, 0, 0, (int)((value) / ProductionTimeLine.ScaleTime)));
       
    30                     this.Width = ((CustomableIndexElementVM)DataContext).Duration;
       
    31                 }
       
    32             }
       
    33         }
       
    34 
       
    35         // Using a DependencyProperty as the backing store for TrimRight.  This enables animation, styling, binding, etc...
       
    36         public static readonly DependencyProperty TrimRightProperty =
       
    37             DependencyProperty.Register("TrimRight", typeof(double), typeof(CustomableIndexElement), null);
       
    38 
       
    39         public CustomableIndexElement()
       
    40         {
       
    41             InitializeComponent();
       
    42         }
       
    43     }
       
    44 }