diff -r 66911d0f0eb6 -r 7d044e7562ea client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/ProductionTimeLineVM.cs --- a/client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/ProductionTimeLineVM.cs Mon Dec 07 10:36:55 2009 +0100 +++ b/client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/ProductionTimeLineVM.cs Tue Dec 08 11:39:27 2009 +0100 @@ -13,6 +13,7 @@ using Iri.Modernisation.BaseMVVM.ViewModel; using Iri.Modernisation.Controls.View; using System.Collections.Generic; +using SLExtensions.Collections.ObjectModel; namespace Iri.Modernisation.Controls.ViewModel { public class ProductionTimeLineVM : BaseMVVM.ViewModel.ViewModel @@ -34,17 +35,31 @@ } private VideoBook _newBook; - private List[] _listVideoSequences = new List[4]; - public List SelectedVideoSequences + private ObservableCollection[] _listVideoSequences = new ObservableCollection[4]; + public ObservableCollection[] ListVideoSequences { get { + return _listVideoSequences; + } + set + { + _listVideoSequences = value; + OnPropertyChanged("ListVideoSequences"); + } + } + + public ObservableCollection SelectedVideoSequences + { + get + { + return _listVideoSequences[SelectedChapter]; } set { _listVideoSequences[SelectedChapter] = value; - _newBook.Chapters[SelectedChapter].VideoSequences = value; + //_newBook.Chapters[SelectedChapter].VideoSequences = value; OnPropertyChanged("SelectedVideoSequences"); } } @@ -115,16 +130,37 @@ public ProductionTimeLineVM() { _newBook = new VideoBook(); - - + _listVideoSequences = new ObservableCollection[4] + { + new ObservableCollection(), + new ObservableCollection(), + new ObservableCollection(), + new ObservableCollection() + }; + // PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(ProductionTimeLineVM_PropertyChanged); + // SelectedVideoSequences = new ObservableCollection(); Commands.ProductionTimeLine.EditorPartSelected.Executed += new EventHandler(EditorPartSelected_Executed); Commands.ProductionTimeLine.EditorPartFinished.Executed += new EventHandler(EditorPartFinished_Executed); - } + _listVideoSequences[0].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); + _listVideoSequences[1].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); + _listVideoSequences[2].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); + _listVideoSequences[3].CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedVideoSequences_CollectionChanged); + + } + + void SelectedVideoSequences_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + { + Commands.ProductionView.VideoRecordUpdated.Execute(); + } + + void ProductionTimeLineVM_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) + { + Commands.ProductionView.VideoRecordUpdated.Execute(); + } void EditorPartFinished_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) { SelectedChapter = -1; - } void EditorPartSelected_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)