diff -r beb938b4fb76 -r bd33267300aa client/src/Iri.Modernisation.Controls/View/HeaderProduction/HeaderProductionChapter.xaml.cs --- a/client/src/Iri.Modernisation.Controls/View/HeaderProduction/HeaderProductionChapter.xaml.cs Wed Jan 27 10:55:59 2010 +0100 +++ b/client/src/Iri.Modernisation.Controls/View/HeaderProduction/HeaderProductionChapter.xaml.cs Thu Feb 04 16:38:04 2010 +0100 @@ -41,25 +41,54 @@ InitializeComponent(); EditionController.Text = Iri.Modernisation.Lang.LangResource.EditingLabel; IndexController.Text = Iri.Modernisation.Lang.LangResource.IndexingLabel; + EnrichmentController.Text = Iri.Modernisation.Lang.LangResource.EnrichmentLabel; // Commands.ActivePart.Executed += new EventHandler(ActivePart_Executed); EditionController.HeaderProductionPartFinished += new EventHandler(EditionController_HeaderProductionPartFinished); IndexController.HeaderProductionPartFinished += new EventHandler(IndexController_HeaderProductionPartFinished); + + EditionController.Clicked += new EventHandler(EditionController_Clicked); + IndexController.Clicked += new EventHandler(IndexController_Clicked); + Commands.HeaderProduction.IndexFinishedOk.Executed += new EventHandler(IndexFinishedOk_Executed); + Commands.HeaderProduction.EditFinishedOk.Executed += new EventHandler(EditFinishedOk_Executed); + } + + void IndexFinishedOk_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) + { + if (DataContext == e.Source) + IndexController.Finish(); + } + + void EditFinishedOk_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) + { + if(DataContext == e.Source) + EditionController.Finish(); + } + + void IndexController_Clicked(object sender, EventArgs e) + { + ((HeaderProductionChapterVM)DataContext).IndexClick(); + } + + + + void EditionController_Clicked(object sender, EventArgs e) + { + ((HeaderProductionChapterVM)DataContext).EditClick(); } void IndexController_HeaderProductionPartFinished(object sender, HeaderProductionPartControlerEventArgs e) { ((HeaderProductionChapterVM)DataContext).Indexing = true; + VisualStateManager.GoToState(EnrichmentController, "Finished", 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