client/src/Iri.Modernisation.Controls/View/ProductionTimeLine/CustomableIndexElement.xaml.cs
author totetm <>
Mon, 25 Jan 2010 09:30:22 +0100
changeset 35 43bb1b8ed555
parent 34 4d9ebc6fbbe8
permissions -rw-r--r--
IRIFiles Class Web Loader and Sender
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
20
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
     1
using System;
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
     2
using System.Collections.Generic;
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
     3
using System.Linq;
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
     4
using System.Net;
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
     5
using System.Windows;
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
     6
using System.Windows.Controls;
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
     7
using System.Windows.Documents;
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
     8
using System.Windows.Input;
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
     9
using System.Windows.Media;
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    10
using System.Windows.Media.Animation;
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    11
using System.Windows.Shapes;
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    12
using Iri.Modernisation.Controls.ViewModel;
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    13
namespace Iri.Modernisation.Controls.View
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    14
{
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    15
    public partial class CustomableIndexElement : UserControl
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    16
    {
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    17
        
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    18
        public double TrimRight
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    19
        {
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    20
            get { return (double)GetValue(TrimRightProperty); }
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    21
            set
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    22
            {
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    23
                if (((CustomableIndexElementVM)DataContext).TimerOut>TimeSpan.Zero)
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    24
                {
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    25
                    SetValue(TrimRightProperty, value);
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    26
                    ((CustomableIndexElementVM)DataContext).TimerOut = ((CustomableIndexElementVM)DataContext).TimerOut.Subtract(new TimeSpan(0, 0, 0, 0, (int)((value) / ProductionTimeLine.ScaleTime)));
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    27
                    this.Width = ((CustomableIndexElementVM)DataContext).Duration;
34
4d9ebc6fbbe8 Web Migration Update
totetm <>
parents: 20
diff changeset
    28
                   
20
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    29
                }
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    30
            }
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    31
        }
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    32
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    33
        // Using a DependencyProperty as the backing store for TrimRight.  This enables animation, styling, binding, etc...
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    34
        public static readonly DependencyProperty TrimRightProperty =
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    35
            DependencyProperty.Register("TrimRight", typeof(double), typeof(CustomableIndexElement), null);
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    36
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    37
        public CustomableIndexElement()
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    38
        {
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    39
            InitializeComponent();
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    40
        }
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    41
    }
c2dd8119a6c1 Update ProductionView
Matthieu Totet
parents:
diff changeset
    42
}