1 //------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 //------------------------------------------------------------
5 namespace System.Activities.Presentation.FreeFormEditing
9 using System.Windows.Data;
10 using System.Diagnostics.CodeAnalysis;
12 [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "The class is used in xaml.")]
13 class ConnectorStartDotConverter : IValueConverter
15 const double Radius = 5.0;
16 const double RadiusForHitTest = 10.0;
18 public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
20 Point point = (Point)value;
21 bool[] parameters = (bool[])parameter;
22 double radius = Radius;
25 radius = RadiusForHitTest;
27 if (parameters[0]) // left point
29 return new Point((point.X - radius), point.Y);
33 return new Point((point.X + radius), point.Y);
37 public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
39 throw FxTrace.Exception.AsError(new NotSupportedException());