# HG changeset patch
# User Matthieu Totet
# Date 1259852743 -3600
# Node ID dde0338cb539e441d6a7deb6e1218ef171a5eb32
# Parent 3f70aee2432f9c3b30aee688d59b7fa22fe3278d
Update ProductionView and Components
diff -r 3f70aee2432f -r dde0338cb539 client/src/Iri.Modernisation.Controls/View/HeaderProduction/HeaderProductionPartControler.xaml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/client/src/Iri.Modernisation.Controls/View/HeaderProduction/HeaderProductionPartControler.xaml Thu Dec 03 16:05:43 2009 +0100
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Collapsed
+
+
+
+
+
+
+
+
+
+
+
+
+
+ False
+
+
+
+
+
+
+ Visible
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Visible
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 3f70aee2432f -r dde0338cb539 client/src/Iri.Modernisation.Controls/View/HeaderProduction/HeaderProductionPartControler.xaml.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/client/src/Iri.Modernisation.Controls/View/HeaderProduction/HeaderProductionPartControler.xaml.cs Thu Dec 03 16:05:43 2009 +0100
@@ -0,0 +1,136 @@
+using System;
+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 System.Windows.Data;
+namespace Iri.Modernisation.Controls.View
+{
+ public partial class HeaderProductionPartControler : UserControl
+ {
+
+
+
+ public bool IsActive
+ {
+ get { return (bool)GetValue(IsActiveProperty); }
+ set
+ {
+
+ if (value)
+ {
+ Active();
+ }
+ else
+ {
+ }
+ SetValue(IsActiveProperty, value);
+ }
+ }
+
+ // Using a DependencyProperty as the backing store for IsActive. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty IsActiveProperty =
+ DependencyProperty.Register("IsActive", typeof(bool), typeof(HeaderProductionPartControler), new PropertyMetadata(false));
+
+
+
+ public String Text
+ {
+ get { return (String)GetValue(TextProperty); }
+ set
+ { SetValue(TextProperty, value);
+ textBlock.Text = value;
+ }
+ }
+
+ // Using a DependencyProperty as the backing store for Text. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty TextProperty =
+ DependencyProperty.Register("Text", typeof(String), typeof(HeaderProductionPartControler), new PropertyMetadata(""));
+
+
+
+ public HeaderProductionPartControler()
+ {
+ // Required to initialize variables
+ InitializeComponent();
+ IsActive = false;
+ _activated = false;
+ _finished= false;
+
+
+
+
+ }
+
+ private bool _activated;
+ private bool _finished;
+
+ public void Active()
+ {
+ if(!_activated && !_finished)
+ {
+ VisualStateManager.GoToState(this,"Available",true);
+ _activated=true;
+ }
+
+ }
+
+ public void UnSelect()
+ {
+ if(_activated && !_finished)
+ VisualStateManager.GoToState(this,"Available",true);
+ }
+ private void Button_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
+ {
+
+
+ }
+
+ private void but_Click(object sender, System.Windows.RoutedEventArgs e)
+ {
+
+ if(_activated)
+ {
+ VisualStateManager.GoToState(this,"Finished",true);
+ if (HeaderProductionPartFinished!=null)
+ {
+ HeaderProductionPartFinished(this, new HeaderProductionPartControlerEventArgs(sender));
+ }
+ _finished=true;
+
+ }
+ }
+ public void Select()
+ {
+ if (_activated && !_finished)
+ {
+ VisualStateManager.GoToState(this, "Selected", true);
+ }
+ }
+ private void textBlock_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
+ {
+ if (_activated && !_finished)
+ {
+ if (HeaderProductionPartSelected != null)
+ HeaderProductionPartSelected(this, new HeaderProductionPartControlerEventArgs(this));
+ }
+ }
+ public event EventHandler HeaderProductionPartUnSelected;
+ public event EventHandler HeaderProductionPartFinished;
+ public event EventHandler HeaderProductionPartSelected;
+ }
+
+ public class HeaderProductionPartControlerEventArgs : EventArgs
+ {
+ public object sender { get; set; }
+ public HeaderProductionPartControlerEventArgs(object psender)
+ {
+ sender = psender;
+ }
+
+ }
+}
\ No newline at end of file
diff -r 3f70aee2432f -r dde0338cb539 client/src/Iri.Modernisation.Controls/ViewModel/ProductionView/ProductionViewVM.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/ProductionView/ProductionViewVM.cs Thu Dec 03 16:05:43 2009 +0100
@@ -0,0 +1,50 @@
+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.BaseMVVM.Commands;
+using Iri.Modernisation.BaseMVVM.ViewModel;
+namespace Iri.Modernisation.Controls.ViewModel
+{
+ public class ProductionViewVM : BaseMVVM.ViewModel.ViewModel
+ {
+ private HeaderProductionVM _headerProductionVM;
+ public HeaderProductionVM ViewModelHeaderProduction
+ {
+ get
+ {
+ return _headerProductionVM;
+ }
+ set
+ {
+ _headerProductionVM = value;
+ OnPropertyChanged("ViewModelHeaderProduction");
+ }
+ }
+ private ProductionTimeLineVM _productionTimeLineVM;
+ public ProductionTimeLineVM ViewModelProductionTimeLine
+ {
+ get
+ {
+ return _productionTimeLineVM;
+ }
+ set
+ {
+ _productionTimeLineVM = value;
+ OnPropertyChanged("ViewModelProductionTimeLine");
+ }
+ }
+
+ public ProductionViewVM()
+ {
+ ViewModelHeaderProduction = new HeaderProductionVM();
+ ViewModelProductionTimeLine = new ProductionTimeLineVM();
+ }
+ }
+}