src/FingersDance.Views/TimelineAnnotationView.xaml.cs
changeset 150 569925b65604
parent 146 dd8ed4d3beb6
child 160 e940ca798fe3
--- a/src/FingersDance.Views/TimelineAnnotationView.xaml.cs	Wed Oct 14 14:06:04 2009 +0200
+++ b/src/FingersDance.Views/TimelineAnnotationView.xaml.cs	Wed Oct 14 17:08:43 2009 +0200
@@ -47,7 +47,7 @@
     {
         public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
         {
-            Visibility v = ((float)value>0) ? Visibility.Visible : Visibility.Hidden;
+            Visibility v = ((float)value > 0) ? Visibility.Visible : Visibility.Hidden;
             return v;
         }
         public object ConvertBack(object value, Type targetTypes, object parameter, System.Globalization.CultureInfo culture)
@@ -55,4 +55,19 @@
             return 1.0;
         }
     }
+
+    public class ColorConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            UInt32 argb = (UInt32)value;
+            Color c = Color.FromArgb((Byte)((argb >> 24) & 0xFF), (Byte)((argb >> 16) & 0xFF), (Byte)((argb >> 8) & 0xFF), (Byte)(argb & 0xFF));
+            SolidColorBrush scb = new SolidColorBrush(c);
+            return scb;
+        }
+        public object ConvertBack(object value, Type targetTypes, object parameter, System.Globalization.CultureInfo culture)
+        {
+            return 1.0;
+        }
+    }
 }