UpFlagConverter.cs 797 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Windows.Data;
  3. namespace Muchinfo.MTPClient.Account.Utilities
  4. {
  5. public class UpFlagConverter : IValueConverter
  6. {
  7. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  8. {
  9. if (value is double)
  10. {
  11. var data = (double)value;
  12. if (data > 0)
  13. {
  14. return "+";
  15. }
  16. else if (data < 0)
  17. {
  18. return "-";
  19. }
  20. }
  21. return "";
  22. }
  23. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  24. {
  25. return 0;
  26. }
  27. }
  28. }