WRStatusToIsEnabledConvert.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using Muchinfo.MTPClient.Data.Enums;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Windows.Data;
  7. namespace Muchinfo.MTPClient.Infrastructure.Converters
  8. {
  9. public class WRStatusToIsEnabledConvert : IValueConverter
  10. {
  11. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  12. {
  13. bool result = false;
  14. if (value != null)
  15. {
  16. var wRStatus = (eWRStatus)value;
  17. switch (wRStatus)
  18. {
  19. case eWRStatus.Normal:
  20. result = true;
  21. break;
  22. case eWRStatus.Canceled:
  23. case eWRStatus.Frozen:
  24. case eWRStatus.Inactive:
  25. //case eWRStatus.:
  26. result = false;
  27. break;
  28. }
  29. }
  30. return result;
  31. }
  32. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  33. {
  34. throw new NotImplementedException();
  35. }
  36. }
  37. }