55
|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
|
69
|
6 |
using FingersDance.Data; |
|
7 |
|
|
8 |
namespace FingersDance.ViewModels |
55
|
9 |
{ |
69
|
10 |
public class CuttingViewModel : ViewModelBase |
55
|
11 |
{ |
|
12 |
private string _title; |
|
13 |
private List<AnnotationViewModel> _annotList = new List<AnnotationViewModel>(); |
69
|
14 |
|
143
|
15 |
public CuttingViewModel(Cutting c, float annotWidth) { |
69
|
16 |
|
|
17 |
this._title = c.Title; |
|
18 |
this._annotList = new List<AnnotationViewModel>(); |
143
|
19 |
int i = 0; |
69
|
20 |
foreach (Annotation annot in c.AnnotList) |
143
|
21 |
{ |
|
22 |
this._annotList.Add(new AnnotationViewModel(annot, annot.TcBegin - (i * annotWidth))); |
|
23 |
i++; |
|
24 |
} |
69
|
25 |
|
|
26 |
} |
|
27 |
|
143
|
28 |
public String Title |
55
|
29 |
{ |
|
30 |
get { return _title; } |
|
31 |
set |
|
32 |
{ |
|
33 |
if (value == _title || String.IsNullOrEmpty(value)) |
|
34 |
return; |
|
35 |
_title = value; |
|
36 |
base.OnPropertyChanged("Title"); |
|
37 |
} |
|
38 |
} |
|
39 |
public List<AnnotationViewModel> AnnotList |
|
40 |
{ |
|
41 |
get { return _annotList; } |
|
42 |
set |
|
43 |
{ |
|
44 |
_annotList = value; |
|
45 |
base.OnPropertyChanged("AnnotList"); |
|
46 |
} |
|
47 |
} |
143
|
48 |
|
|
49 |
public void setListFromAnnotations(List<Annotation> annotList, float annotWidth) |
|
50 |
{ |
|
51 |
|
|
52 |
this._annotList = new List<AnnotationViewModel>(); |
|
53 |
int i = 0; |
|
54 |
foreach (Annotation annot in annotList) |
|
55 |
{ |
|
56 |
this._annotList.Add(new AnnotationViewModel(annot, annot.TcBegin - (i * annotWidth))); |
|
57 |
i++; |
|
58 |
} |
|
59 |
|
|
60 |
} |
55
|
61 |
} |
|
62 |
} |