client/src/Iri.Modernisation.Controls/View/HeaderProduction/HeaderProductionChapter.xaml.cs
changeset 27 f292db96b050
parent 26 44a2dc869e28
child 38 bd33267300aa
--- a/client/src/Iri.Modernisation.Controls/View/HeaderProduction/HeaderProductionChapter.xaml.cs	Tue Dec 22 16:22:22 2009 +0100
+++ b/client/src/Iri.Modernisation.Controls/View/HeaderProduction/HeaderProductionChapter.xaml.cs	Mon Jan 04 10:29:39 2010 +0100
@@ -7,15 +7,59 @@
 using System.Windows.Media;
 using System.Windows.Media.Animation;
 using System.Windows.Shapes;
-
-namespace Iri.Modernisation.Controls
+using Iri.Modernisation.Controls.ViewModel;
+using Iri.Modernisation.BaseMVVM.Commands;
+namespace Iri.Modernisation.Controls.View
 {
 	public partial class HeaderProductionChapter : UserControl
 	{
+
+
+
+
+            
+        public bool Selected
+        {
+            get { return (bool)GetValue(SelectedProperty); }
+            set 
+            { 
+                SetValue(SelectedProperty, value);
+                
+            }
+
+        }
+
+        // Using a DependencyProperty as the backing store for Selected.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty SelectedProperty =
+            DependencyProperty.Register("Selected", typeof(bool), typeof(HeaderProductionChapter), new PropertyMetadata(false));
+
+
+
 		public HeaderProductionChapter()
 		{
 			// Required to initialize variables
 			InitializeComponent();
-		}
+			 EditionController.Text = Iri.Modernisation.Lang.LangResource.EditingLabel;
+             IndexController.Text = Iri.Modernisation.Lang.LangResource.IndexingLabel;
+            // Commands.ActivePart.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(ActivePart_Executed);
+             EditionController.HeaderProductionPartFinished += new EventHandler<HeaderProductionPartControlerEventArgs>(EditionController_HeaderProductionPartFinished);
+             IndexController.HeaderProductionPartFinished += new EventHandler<HeaderProductionPartControlerEventArgs>(IndexController_HeaderProductionPartFinished);
+        }
+
+        void IndexController_HeaderProductionPartFinished(object sender, HeaderProductionPartControlerEventArgs e)
+        {
+            ((HeaderProductionChapterVM)DataContext).Indexing = true;
+        }
+
+        void EditionController_HeaderProductionPartFinished(object sender, HeaderProductionPartControlerEventArgs e)
+        {
+            ((HeaderProductionChapterVM)DataContext).Editing = true;
+        }
+
+        void ActivePart_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
+        {
+          
+                //IndexController.IsActive = true;
+        }
 	}
 }
\ No newline at end of file