author | cavaliet |
Wed, 28 Oct 2009 17:07:27 +0100 | |
changeset 182 | 25b49d4f1635 |
parent 167 | 206f07a8d887 |
child 192 | 11083c390ce4 |
permissions | -rw-r--r-- |
55 | 1 |
using System; |
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
160
e940ca798fe3
Enhance color factory and send the current project (data) to the timeline instance in order to build the project's cutting's annotation list.
cavaliet
parents:
150
diff
changeset
|
5 |
using System.Windows.Media; |
55 | 6 |
|
69 | 7 |
using FingersDance.Data; |
8 |
||
9 |
namespace FingersDance.ViewModels |
|
55 | 10 |
{ |
69 | 11 |
public class AnnotationViewModel : ViewModelBase |
55 | 12 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
13 |
readonly Annotation a; |
55 | 14 |
|
143 | 15 |
private float _marginLeft; |
167
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
16 |
private Double _scaleX = 1; |
143 | 17 |
|
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
18 |
public AnnotationViewModel(Annotation aPar, float marginLeft, Double scaleX) |
167
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
19 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
20 |
a = aPar; |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
21 |
|
167
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
22 |
this._marginLeft = marginLeft; |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
23 |
this._marginLeft = marginLeft; |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
24 |
this._scaleX = scaleX; |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
25 |
} |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
26 |
public AnnotationViewModel(Annotation aPar, float marginLeft) |
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
27 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
28 |
a = aPar; |
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
29 |
|
143 | 30 |
this._marginLeft = marginLeft; |
69 | 31 |
} |
32 |
||
33 |
public float TcBegin |
|
55 | 34 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
35 |
get { return a.TcBegin; } |
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
36 |
set |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
37 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
38 |
if (value == a.TcBegin || float.IsNaN(value)) |
55 | 39 |
return; |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
40 |
a.TcBegin = value; |
55 | 41 |
base.OnPropertyChanged("TcBegin"); |
42 |
} |
|
43 |
} |
|
69 | 44 |
public float Dur |
55 | 45 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
46 |
get { return a.Dur; } |
55 | 47 |
set |
48 |
{ |
|
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
49 |
if (value == a.Dur || float.IsNaN(value)) |
55 | 50 |
return; |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
51 |
a.Dur = value; |
55 | 52 |
base.OnPropertyChanged("Dur"); |
53 |
} |
|
54 |
} |
|
69 | 55 |
public String GestureType |
55 | 56 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
57 |
get { return a.GestureType; } |
55 | 58 |
set |
59 |
{ |
|
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
60 |
if (value == a.GestureType || String.IsNullOrEmpty(value)) |
55 | 61 |
return; |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
62 |
a.GestureType = value; |
55 | 63 |
base.OnPropertyChanged("GestureType"); |
64 |
} |
|
65 |
} |
|
160
e940ca798fe3
Enhance color factory and send the current project (data) to the timeline instance in order to build the project's cutting's annotation list.
cavaliet
parents:
150
diff
changeset
|
66 |
public Color Color |
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
67 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
68 |
get { return a.Color; } |
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
69 |
set |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
70 |
{ |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
71 |
if (value == a.Color) |
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
72 |
return; |
182
25b49d4f1635
First step of data reorganisation : session is meant to disappear : a "session" is in fact a project and one project owns several cuttings, one per user. WARNING : this commit builds without problems but we can not open more than one UserPanel.
cavaliet
parents:
167
diff
changeset
|
73 |
a.Color = value; |
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
74 |
} |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
75 |
} |
143 | 76 |
public float MarginLeft |
77 |
{ |
|
78 |
get { return _marginLeft; } |
|
79 |
set |
|
80 |
{ |
|
81 |
if (value == _marginLeft || float.IsNaN(value)) |
|
82 |
return; |
|
83 |
_marginLeft = value; |
|
84 |
base.OnPropertyChanged("MarginLeft"); |
|
85 |
} |
|
86 |
} |
|
167
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
87 |
public Double ScaleX |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
88 |
{ |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
89 |
get { return _scaleX; } |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
90 |
set |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
91 |
{ |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
92 |
if (value == _scaleX || Double.IsNaN(value)) |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
93 |
return; |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
94 |
_scaleX = value; |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
95 |
base.OnPropertyChanged("ScaleX"); |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
96 |
} |
206f07a8d887
Annotation's scale is now still visually at one, whatever the timeline's scale.
cavaliet
parents:
160
diff
changeset
|
97 |
} |
55 | 98 |
|
99 |
} |
|
100 |
} |