client/src/Iri.Modernisation.Controls/ViewModel/HeaderProduction/HeaderProductionChapterVM.cs
changeset 27 f292db96b050
parent 26 44a2dc869e28
child 31 775d895e5d4d
equal deleted inserted replaced
26:44a2dc869e28 27:f292db96b050
     6 using System.Windows.Ink;
     6 using System.Windows.Ink;
     7 using System.Windows.Input;
     7 using System.Windows.Input;
     8 using System.Windows.Media;
     8 using System.Windows.Media;
     9 using System.Windows.Media.Animation;
     9 using System.Windows.Media.Animation;
    10 using System.Windows.Shapes;
    10 using System.Windows.Shapes;
    11 
    11 using Iri.Modernisation.BaseMVVM.Commands;
       
    12 using Iri.Modernisation.Data.Models;
    12 namespace Iri.Modernisation.Controls.ViewModel
    13 namespace Iri.Modernisation.Controls.ViewModel
    13 {
    14 {
    14     public class HeaderProductionChapterVM : BaseMVVM.ViewModel.ViewModel
    15     public class HeaderProductionChapterVM : BaseMVVM.ViewModel.ViewModel
    15     {
    16     {
    16         private bool _isEnable;
    17         private VideoChapterDescription _chapterDescription;
    17         public bool IsEnable
    18         public VideoChapterDescription ChapterDescription
    18         {
    19         {
    19             get
    20             get
    20             {
    21             {
    21                 return _isEnable;
    22                 return _chapterDescription;
       
    23             }
       
    24             private set
       
    25             {
       
    26                 _chapterDescription = value;
       
    27                 OnPropertyChanged("ChapterDescription");
       
    28             }
       
    29         }
       
    30 
       
    31 
       
    32         private bool _isActive;
       
    33         public bool IsActive
       
    34         {
       
    35             get
       
    36             {
       
    37                 return _isActive;
    22             }
    38             }
    23             set
    39             set
    24             {
    40             {
    25                 _isEnable = value;
    41                 _isActive = value;
    26                 OnPropertyChanged("IsEnable");
    42                 OnPropertyChanged("IsActive");
    27             }
    43             }
    28         }
    44         }
    29 
    45 
    30         private bool _editing;
    46         private bool _editing=false;
    31         public bool Editing
    47         public bool Editing
    32         {
    48         {
    33             get
    49             get
    34             {
    50             {
    35                 return _editing;
    51                 return _editing;
    36             }
    52             }
    37             set
    53             set
    38             {
    54             {
    39                 _editing = value;
    55                 _editing = value;
    40                 if (_next != null)
    56 
    41                 {
    57                 if(EditEnded!=null)
    42                     _next.Enable();
    58                 EditEnded();
    43                 }
    59 
    44                 OnPropertyChanged("Editing");
    60                 OnPropertyChanged("Editing");
    45             }
    61             }
    46         }
    62         }
    47 
    63 
    48         private bool _indexing;
    64         private bool _indexing=false;
    49         public bool Indexing
    65         public bool Indexing
    50         {
    66         {
    51             get
    67             get
    52             {
    68             {
    53                 return _indexing;
    69                 return _indexing;
    54             }
    70             }
    55             set
    71             set
    56             {
    72             {
    57                 _indexing = value;
    73                 _indexing = value;
    58                 OnPropertyChanged("Indexing");
    74                 OnPropertyChanged("Indexing");
       
    75                 if (Ended!=null)
       
    76                 {
       
    77                     Ended();
       
    78                 }
    59             }
    79             }
    60         }
    80         }
    61 
    81 
    62         private HeaderProductionChapterVM _next;
    82         private bool _highLight;
       
    83         public bool HighLight
       
    84         {
       
    85             get
       
    86             {
       
    87                 return _highLight;
       
    88             }
       
    89             set
       
    90             {
       
    91                 _highLight = value;
       
    92                 OnPropertyChanged(String.Empty);
       
    93             }
       
    94         }
       
    95 
       
    96         private HeaderProductionChapterVM _next=null;
       
    97         public HeaderProductionChapterVM Next
       
    98         {
       
    99             get
       
   100             {
       
   101                 return _next;
       
   102             }
       
   103             set
       
   104             {
       
   105                 _next = value;
       
   106                 OnPropertyChanged("Next");
       
   107             }
       
   108         }
       
   109 
       
   110         private String _title;
       
   111         public String Title
       
   112         {
       
   113             get
       
   114             {
       
   115                 return _title;
       
   116             }
       
   117             set
       
   118             {
       
   119                 _title = value;
       
   120                 OnPropertyChanged("Title");
       
   121             }
       
   122         }
    63 
   123 
    64         public void Enable()
   124         public void Enable()
    65         {
   125         {
    66             IsEnable = true;
   126             IsActive = true;
       
   127            // Commands.ActivePart.Execute(null,this);
    67         }
   128         }
    68 
   129 
    69         public HeaderProductionChapterVM()
   130        
       
   131 
       
   132         public HeaderProductionChapterVM(VideoChapterDescription Vcd)
    70         {
   133         {
       
   134             _chapterDescription = Vcd;
       
   135             _title = Vcd.Title;
       
   136             HighLight = false;
       
   137            
    71         }
   138         }
       
   139        
       
   140         public delegate void EditEndedDelegate();
       
   141         public event EditEndedDelegate EditEnded;
       
   142 
       
   143         public delegate void EndedDelegate();
       
   144         public event EndedDelegate Ended;
    72 
   145 
    73 
   146 
    74     }
   147     }
    75 }
   148 }