RolloverDataPointerInfoConverter.cs 943 B

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows.Data;
  6. using Aitex.Core.RT.Log;
  7. namespace Aitex.Core.UI.Converters
  8. {
  9. public class RolloverDataPointerInfoConverter : IMultiValueConverter
  10. {
  11. public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  12. {
  13. try
  14. {
  15. DateTime time = (DateTime)values[0];
  16. double y = (double)values[1];
  17. return string.Format("【{0}】 {1}", time.ToString("yyyy/MM/dd HH:mm:ss"), y);
  18. }
  19. catch (Exception ex)
  20. {
  21. LOG.Write(ex);
  22. }
  23. return "";
  24. }
  25. public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
  26. {
  27. return null;
  28. }
  29. }
  30. }