client/src/Iri.Modernisation.Controls/View/HeaderProduction/HeaderProductionChapter.xaml.cs
author totetm <>
Thu, 11 Feb 2010 17:29:23 +0100
changeset 42 594fdedecf7f
parent 38 bd33267300aa
permissions -rw-r--r--
Fixed| bouton close sur BookTimeLine Fixed| loading blocker sur les éléments du corpus vidéolivre (book a charger) Fixed| afficher l'état sur on load et loader sur les éléments du corpus vidéolivre ("book a charger") Fixed| bug du title sur book timline Fixed| Actualisation de l'affichage des annotations sur seek de la timline sans play Fixed| Seek possible quand play Fixed| Bug sur le placement tetris ? Fixed| texte par default sur les champs d'annotations

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 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;
             EnrichmentController.Text = Iri.Modernisation.Lang.LangResource.EnrichmentLabel;
            // Commands.ActivePart.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(ActivePart_Executed);
             EditionController.HeaderProductionPartFinished += new EventHandler<HeaderProductionPartControlerEventArgs>(EditionController_HeaderProductionPartFinished);
             IndexController.HeaderProductionPartFinished += new EventHandler<HeaderProductionPartControlerEventArgs>(IndexController_HeaderProductionPartFinished);

             EditionController.Clicked += new EventHandler(EditionController_Clicked);
             IndexController.Clicked += new EventHandler(IndexController_Clicked);
             Commands.HeaderProduction.IndexFinishedOk.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(IndexFinishedOk_Executed);
             Commands.HeaderProduction.EditFinishedOk.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(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;
         
        }
      
        
    
	}
}