WarningDirectionConverter.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. using Muchinfo.MTPClient.Data.Enums;
  2. using Muchinfo.MTPClient.Resources;
  3. using System;
  4. using System.Windows.Data;
  5. namespace Muchinfo.MTPClient.Infrastructure.Converters
  6. {
  7. public class WarningDirectionConverter : IValueConverter
  8. {
  9. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  10. {
  11. string result = string.Empty;
  12. if (value != null)
  13. {
  14. var warningType = (Direction)value;
  15. switch (warningType)
  16. {
  17. case Direction.Ask:
  18. result = Client_Resource.Infrastructure_sell;
  19. break;
  20. case Direction.Bid:
  21. result = Client_Resource.Infrastructure_buy;
  22. break;
  23. }
  24. }
  25. return result;
  26. }
  27. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  28. {
  29. throw new NotImplementedException();
  30. }
  31. }
  32. }