author | PAMPHILE Jonathan <pamphile@efrei.fr> |
Fri, 16 Oct 2009 09:02:04 +0200 | |
changeset 157 | 0fd2b41ab402 |
parent 150 | 569925b65604 |
child 160 | e940ca798fe3 |
permissions | -rw-r--r-- |
55 | 1 |
using System; |
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Windows; |
|
6 |
using System.Windows.Controls; |
|
7 |
using System.Windows.Data; |
|
8 |
using System.Windows.Documents; |
|
9 |
using System.Windows.Input; |
|
10 |
using System.Windows.Media; |
|
11 |
using System.Windows.Media.Imaging; |
|
12 |
using System.Windows.Navigation; |
|
13 |
using System.Windows.Shapes; |
|
143 | 14 |
using Microsoft.Surface.Presentation; |
55 | 15 |
|
16 |
namespace FingersDance.Views |
|
17 |
{ |
|
18 |
/// <summary> |
|
19 |
/// Interaction logic for TimelineAnnotationView.xaml |
|
20 |
/// </summary> |
|
21 |
public partial class TimelineAnnotationView : UserControl |
|
22 |
{ |
|
23 |
public TimelineAnnotationView() |
|
24 |
{ |
|
25 |
InitializeComponent(); |
|
26 |
} |
|
27 |
} |
|
71 | 28 |
|
29 |
public class ThicknessSingleValueConverter : IValueConverter |
|
30 |
{ |
|
31 |
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
|
32 |
{ |
|
33 |
ThicknessConverter myThicknessConverter = new ThicknessConverter(); |
|
34 |
Thickness th1 = (Thickness)myThicknessConverter.ConvertFrom(value); |
|
74
7ce946833eae
First step of data binding where we can add an annotation by clicking on the timeline
cavaliet
parents:
71
diff
changeset
|
35 |
th1.Top = 0; |
7ce946833eae
First step of data binding where we can add an annotation by clicking on the timeline
cavaliet
parents:
71
diff
changeset
|
36 |
th1.Bottom = th1.Right = 0; |
71 | 37 |
return th1; |
38 |
} |
|
39 |
public object ConvertBack(object value, Type targetTypes, object parameter, System.Globalization.CultureInfo culture) |
|
40 |
{ |
|
41 |
Thickness thickness = (Thickness)value; |
|
42 |
return thickness.Left; |
|
43 |
} |
|
44 |
} |
|
143 | 45 |
|
46 |
public class VisibilityConverter : IValueConverter |
|
47 |
{ |
|
48 |
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
|
49 |
{ |
|
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
50 |
Visibility v = ((float)value > 0) ? Visibility.Visible : Visibility.Hidden; |
143 | 51 |
return v; |
52 |
} |
|
53 |
public object ConvertBack(object value, Type targetTypes, object parameter, System.Globalization.CultureInfo culture) |
|
54 |
{ |
|
55 |
return 1.0; |
|
56 |
} |
|
57 |
} |
|
150
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
58 |
|
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
59 |
public class ColorConverter : IValueConverter |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
60 |
{ |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
61 |
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
62 |
{ |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
63 |
UInt32 argb = (UInt32)value; |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
64 |
Color c = Color.FromArgb((Byte)((argb >> 24) & 0xFF), (Byte)((argb >> 16) & 0xFF), (Byte)((argb >> 8) & 0xFF), (Byte)(argb & 0xFF)); |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
65 |
SolidColorBrush scb = new SolidColorBrush(c); |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
66 |
return scb; |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
67 |
} |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
68 |
public object ConvertBack(object value, Type targetTypes, object parameter, System.Globalization.CultureInfo culture) |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
69 |
{ |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
70 |
return 1.0; |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
71 |
} |
569925b65604
Annotations are now colored with the same color as the pivot's button
cavaliet
parents:
146
diff
changeset
|
72 |
} |
55 | 73 |
} |