client/src/Iri.Modernisation.Controls/ViewModel/ProductionEditor/ProductionEditorVM.cs
changeset 29 5f8d275750e7
parent 25 a9c815025a1b
child 35 43bb1b8ed555
equal deleted inserted replaced
28:2d4ec5ab2a40 29:5f8d275750e7
    11 using Iri.Modernisation.BaseMVVM;
    11 using Iri.Modernisation.BaseMVVM;
    12 using Iri.Modernisation.Data.Models;
    12 using Iri.Modernisation.Data.Models;
    13 using System.Collections.Generic;
    13 using System.Collections.Generic;
    14 using System.Linq;
    14 using System.Linq;
    15 using Iri.Modernisation.BaseMVVM.Commands;
    15 using Iri.Modernisation.BaseMVVM.Commands;
       
    16 
    16 namespace Iri.Modernisation.Controls.ViewModel
    17 namespace Iri.Modernisation.Controls.ViewModel
    17 {
    18 {
    18     public class ProductionEditorVM: BaseMVVM.ViewModel.ViewModel
    19     public class ProductionEditorVM: BaseMVVM.ViewModel.ViewModel
    19     {
    20     {
       
    21         private CaptureSource _captureSource;
       
    22         public CaptureSource CaptureSource
       
    23         {
       
    24             get
       
    25             {
       
    26                 return _captureSource;
       
    27             }
       
    28             set
       
    29             {
       
    30                 _captureSource = value;
       
    31                 OnPropertyChanged("CaptureSource");
       
    32             }
       
    33         }
       
    34 
    20         private VideoViewerVM _videoViewerVM;
    35         private VideoViewerVM _videoViewerVM;
    21         public VideoViewerVM ViewModelVideoViewer
    36         public VideoViewerVM ViewModelVideoViewer
    22         {
    37         {
    23             get
    38             get
    24             {
    39             {
    96                 return _isRecordMode;
   111                 return _isRecordMode;
    97             }
   112             }
    98             set
   113             set
    99             {
   114             {
   100                 _isRecordMode = value;
   115                 _isRecordMode = value;
       
   116                 IsEditMode = !value;
       
   117                 if (value)
       
   118                 {
       
   119                     
       
   120 
       
   121                 }
       
   122                 else
       
   123                 {
       
   124               
       
   125                 }
   101                 OnPropertyChanged("IsRecordMode");
   126                 OnPropertyChanged("IsRecordMode");
       
   127               
   102             }
   128             }
   103         }
   129         }
   104 
   130 
       
   131         private bool _isEditMode;
       
   132         public bool IsEditMode
       
   133         {
       
   134             get
       
   135             {
       
   136                 return _isEditMode;
       
   137             }
       
   138             set
       
   139             {
       
   140                 _isEditMode = value;
       
   141                 OnPropertyChanged("IsEditMode");
       
   142             }
       
   143         }
       
   144 
       
   145      
   105         private bool _isEditableIndex;
   146         private bool _isEditableIndex;
   106         public bool IsEditableIndex
   147         public bool IsEditableIndex
   107         {
   148         {
   108             get
   149             get
   109             {
   150             {
   125             ViewModelVideoViewer = new VideoViewerVM(true, false)
   166             ViewModelVideoViewer = new VideoViewerVM(true, false)
   126                 {
   167                 {
   127                    Source = Vs.Path
   168                    Source = Vs.Path
   128                 };
   169                 };
   129             ViewModelVideoViewer.AutoPlay = false;
   170             ViewModelVideoViewer.AutoPlay = false;
       
   171             IsRecordMode = false;
   130             InitializeCommands();
   172             InitializeCommands();
   131         }
   173         }
   132         private void InitializeCommands()
   174         private void InitializeCommands()
   133         {
   175         {
   134 
   176 
   135             Commands.ProductionTimeLine.IndexSelected.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(IndexSelected_Executed);
   177             Commands.ProductionTimeLine.IndexSelected.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(IndexSelected_Executed);
   136 
   178 
       
   179        
   137         }
   180         }
   138         void IndexSelected_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
   181         void IndexSelected_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
   139         {
   182         {
       
   183            
   140             IsEditableIndex = (bool)e.Parameter;
   184             IsEditableIndex = (bool)e.Parameter;
   141             _selectedSegmentIndex = (SegmentIndex)e.Source;
   185             _selectedSegmentIndex = (SegmentIndex)e.Source;
   142             _selectedIndexTitle = _selectedSegmentIndex.Title;
   186             _selectedIndexTitle = _selectedSegmentIndex.Title;
   143             _selectedIndexTags = _selectedSegmentIndex.Tags;
   187             _selectedIndexTags = _selectedSegmentIndex.Tags;
   144             _selectedIndexDescription = _selectedSegmentIndex.Description;
   188             _selectedIndexDescription = _selectedSegmentIndex.Description;