Exemple #1
0
 private bool Equals(BodyChartMark other)
 {
     if (Id != -1 && other.Id != -1)
     {
         return(Id == other.Id);
     }
     return(Math.Abs(X - other.X) < double.Epsilon && Math.Abs(Y - other.Y) < double.Epsilon);
 }
Exemple #2
0
        public static void DrawMark(Canvas canvas, BodyChartMark mark, MouseButtonEventHandler handler = null)
        {
            var ellipse = new Ellipse();

            ellipse.SetValue(Canvas.LeftProperty, mark.X);
            ellipse.SetValue(Canvas.TopProperty, mark.Y);

            ellipse.StrokeThickness = 2;
            ellipse.Width           = ellipse.Height = 2 * DrawRadius;
            ellipse.SetBinding(Shape.StrokeProperty, new Binding("PainLevel")
            {
                Source = mark, Converter = new PainToColorConverter()
            });

            if (handler != null)
            {
                ellipse.MouseLeftButtonUp += handler;
            }

            canvas.Children.Add(ellipse);
        }
Exemple #3
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     return(new SolidColorBrush(value == null ? BodyChartMark.ColorForIndex(-1) : BodyChartMark.ColorForIndex((int)value - 1)));
 }