JugetoStringConvet.cs 940 B

1234567891011121314151617181920212223242526272829303132
  1. using LogoForceTestApp.Modules.MainModule.Enums;
  2. using System;
  3. using System.Globalization;
  4. using System.Windows.Data;
  5. namespace LogoForceTestApp
  6. {
  7. internal class JugetoStringConvet : IValueConverter
  8. {
  9. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  10. {
  11. if (value is RunResultState juge)
  12. {
  13. var content = juge switch
  14. {
  15. RunResultState.NG => "NG",
  16. RunResultState.OK => "OK",
  17. RunResultState.NOTDEFINED => "Wait",
  18. _ => throw new NotImplementedException()
  19. };
  20. return content;
  21. }
  22. return "Wait";
  23. }
  24. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  25. {
  26. throw new NotImplementedException();
  27. }
  28. }
  29. }