/// <summary>
 /// Gets the value of top y coordinate specified marker of <see cref="ErrorBarGraph"/> by its <see cref="DynamicMarkerViewModel"/>.
 /// </summary>
 /// <param name="value">An instance of <see cref="DynamicMarkerViewModel"/> class describing specified marker.</param>
 /// <param name="targetType"></param>
 /// <param name="parameter"></param>
 /// <param name="culture"></param>
 /// <returns>Top y coordinate of bar. Null if the value is null.</returns>
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     try
     {
         if (value == null)
         {
             return(value);
         }
         DynamicMarkerViewModel model = value as DynamicMarkerViewModel;
         if (model != null)
         {
             return(System.Convert.ToDouble(model.Sources["Y"], CultureInfo.InvariantCulture) +
                    System.Convert.ToDouble(model.Sources["H"], CultureInfo.InvariantCulture) / 2);
         }
         else
         {
             return(0);
         }
     }
     catch (Exception exc)
     {
         Debug.WriteLine("Cannot convert value: " + exc.Message);
         return(0);
     }
 }
 /// <summary>
 /// Gets data bounds of a marker of <see cref="MarkerGraph"/> by its <see cref="DynamicMarkerViewModel"/>.
 /// </summary>
 /// <param name="value">An instance of <see cref="DynamicMarkerViewModel"/> class describing specified marker.</param>
 /// <param name="targetType"></param>
 /// <param name="parameter"></param>
 /// <param name="culture"></param>
 /// <returns>Data bounds of specified marker of marker graph.</returns>
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     try
     {
         DynamicMarkerViewModel model = value as DynamicMarkerViewModel;
         double x = System.Convert.ToDouble(model.Sources["X"], CultureInfo.InvariantCulture);
         double y = System.Convert.ToDouble(model.Sources["Y"], CultureInfo.InvariantCulture);
         return(new DataRect(x, y, x, y));
     }
     catch (Exception exc)
     {
         Debug.WriteLine("Cannot convert value to DataRect: " + exc.Message);
         return(new DataRect());
     }
 }
 /// <summary>
 /// Gets screen thickness of a marker of <see cref="MarkerGraph"/> by its <see cref="DynamicMarkerViewModel"/>.
 /// </summary>
 /// <param name="value">An instance of <see cref="DynamicMarkerViewModel"/> class describing specified marker.</param>
 /// <param name="targetType"></param>
 /// <param name="parameter"></param>
 /// <param name="culture"></param>
 /// <returns>Screen thickness of specified marker of marker graph. If it is 0 than returns 5.</returns>
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     try
     {
         DynamicMarkerViewModel model = value as DynamicMarkerViewModel;
         double d = System.Convert.ToDouble(model[seriesName], CultureInfo.InvariantCulture);
         if (d == 0)
         {
             d = 10;
         }
         return(new Thickness(d / 2.0));
     }
     catch (Exception exc)
     {
         Debug.WriteLine("Cannot convert value to Thickness: " + exc.Message);
         return(new Thickness());
     }
 }