src/FingersDance.ViewModel/CuttingViewModel.cs
changeset 143 9f157d9c725b
parent 69 a4c44555f205
child 146 dd8ed4d3beb6
--- a/src/FingersDance.ViewModel/CuttingViewModel.cs	Tue Oct 13 19:09:46 2009 +0200
+++ b/src/FingersDance.ViewModel/CuttingViewModel.cs	Tue Oct 13 19:33:13 2009 +0200
@@ -12,16 +12,20 @@
         private string _title;
         private List<AnnotationViewModel> _annotList = new List<AnnotationViewModel>();
 
-        public CuttingViewModel(Cutting c) {
+        public CuttingViewModel(Cutting c, float annotWidth) {
 
             this._title = c.Title;
             this._annotList = new List<AnnotationViewModel>();
+            int i = 0;
             foreach (Annotation annot in c.AnnotList)
-                this._annotList.Add(new AnnotationViewModel(annot));
+            {
+                this._annotList.Add(new AnnotationViewModel(annot, annot.TcBegin - (i * annotWidth)));
+                i++;
+            }
 
         }
 
-        public String Title
+        public String Title  
         {
             get { return _title; }
             set
@@ -41,5 +45,18 @@
                 base.OnPropertyChanged("AnnotList");
             }
         }
+
+        public void setListFromAnnotations(List<Annotation> annotList, float annotWidth)
+        {
+
+            this._annotList = new List<AnnotationViewModel>();
+            int i = 0;
+            foreach (Annotation annot in annotList)
+            {
+                this._annotList.Add(new AnnotationViewModel(annot, annot.TcBegin - (i * annotWidth)));
+                i++;
+            }
+
+        }
     }
 }