CommonConverter.cs 1016 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Data;
  7. namespace VirgoUI.Client.Models.Converter
  8. {
  9. public class FOUPStatusConverter : IValueConverter
  10. {
  11. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  12. {
  13. if (value == null)
  14. return string.Empty;
  15. string result = string.Empty;
  16. int iValue;
  17. if (int.TryParse(value.ToString(), out iValue))
  18. {
  19. if (iValue == 0)
  20. result = "Loaded";
  21. else if (iValue == 1)
  22. result = "Mapped";
  23. }
  24. return result;
  25. }
  26. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  27. {
  28. throw new NotImplementedException();
  29. }
  30. }
  31. }